I will make a script that will give the player a tool when he is standing on a part Example - player steps on a plate and he gets a sword and when he steps off the sword will disappear.
I will script all of that tool giving stuff myself, but I don't have any clue on how to see when the player is on the part.
I don't think I can just use a Touched event, because it will only detect the player stepping on the platform and not stepping off.
The above code detects whether a player has a humanoid if it does then it will read true once the player has stepped of a part.
local debounce = true script.Parent.TouchEnded:Connect(function(hit) if debounce then if hit.Parent:FindFirstChild("Humanoid") then debounce = false wait(1) print ("Player stepped on a part") end end end)
You can use TouchEnded.
local sp = script.Parent sp.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then -- Check if its a player --give weapon end end) sp.TouchEnded:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then -- Checks for player local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- Gets player from character player.Backpack:findFirstChild("TOOLNAME"):Destroy() -- Destroys tool end end);
There are more efficient ways, but this is fine where you're at.