Hi! A new developer to the devforum here. I recently started making a “horror” themed game on roblox, but when starting with the scripting, I immediately ran into an error with my script.
*
I want to make a script that teleports the person into a “House Entered” place when touched a part.
BUT… when I touch the part it doesn’t teleport me anywhere.
I have tried making it with clickdetector too, but that did not work neither.
local buttonPressed = false
--Store whether the button is pressed in a local variable
script.Parent.Touched:Connect(function(hit)
if not buttonPressed then
-- Is it not pressed?
buttonPressed = true
-- DO STUFF
wait(3) -- time it takes for the p;layer to be able to do stuff again
buttonPressed = false
-- Mark it as not pressed, so other handlers can execute again
end
end)