Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Documentation Example code broken!! #4

Open
Supergamerrr opened this issue Oct 29, 2022 · 1 comment
Open

Documentation Example code broken!! #4

Supergamerrr opened this issue Oct 29, 2022 · 1 comment

Comments

@Supergamerrr
Copy link

This not working(

TEST.312.mp4
@Supergamerrr
Copy link
Author

New example code
EXAMPLE 1

local GuiCollisionService = require(game:GetService("ReplicatedStorage").GuiCollisionService)
local group = GuiCollisionService.createCollisionGroup()

group:addHitter(script.Parent.Move, {}) -- Player or character
group:addCollider(script.Parent.Still, false) -- Add collision
group:addCollider(script.Parent.Still2, false) -- Add collision
group:addCollider(script.Parent.Still3, false) -- Add collision
-- You can add more collisions
-- group:addCollider(COLLISION, false)

local connection;

connection = group:getHitter(1).CollidersTouched.Event:Connect(function(hits)
	if hits then
		-- HERE YOU CODE
		hits[1]:Destroy() -- Destroy collision
		--connection:Disconnect() -- If you want stop this script
	end
end)

EXAMPLE 2

local GuiCollisionService = require(game:GetService("ReplicatedStorage").GuiCollisionService)
local group = GuiCollisionService.createCollisionGroup()

group:addHitter(script.Parent.Move, {}) -- Player or character
group:addCollider(script.Parent.Still, false) -- Add collision
group:addCollider(script.Parent.Still2, false) -- Add collision
group:addCollider(script.Parent.Still3, false) -- Add collision
-- You can add more collisions
-- group:addCollider(COLLISION, false)

group:getHitter(1).CollidersTouched.Event:Connect(function(hits) -- If player started touching collision
	group:getHitter(1).BackgroundColor3 = Color3.new(0.333333, 1, 0) -- Change background player
end)

group:getHitter(1).OnCollisionEnded.Event:Connect(function() -- If player stopped touching collision
	group:getHitter(1).BackgroundColor3 = Color3.new(0.0862745, 0.0862745, 0.0862745)  -- Change background player
end)

Sorry for my bad english.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant