✓ Accepted answer
There are few ways to do that, one way is what Percil said, another simply create a BoolValue Into the part and call it 'Touching' or you can just create a Touching Variable which I do recommend because it's easier. Then in your script add a few lines;
local P = script.Parent
local Touching = false
local ws = game.Workspace
local sound = ws:WaitForChild('Sound')
local B = ws:WaitForChild('BasePlate')
P.Touched:Connect(function(H)
if Touching == true then return end
else
sound:Play()
Touching = true
end)
B.Touched:Connect(function()
Touching = false
end)
The last function above;
B.Touched:Connect(function()
Touching = false
end)
Will change Touching back to false if the player steps off the part so if the player steps on a baseplate then touching becomes false and the player can go back on again.
If this helped then please accept answer ;)
1 comment
Touched is an event. Events don't work like that; you can't just use them in if statements. Look into the TouchEnded event, that might work for you.