Teleporting between places script error

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.

Thanks for reading.

2 Likes

For this script I used the developer.roblox.com script, by the way.

1 Like

Did you tested this in studio?
Did you enabled HTTP service?

1 Like

I tested this in studio, and I have HTTP requests turned on.

You cant teleport in studio. Run it in roblox launcher.

Ahh, alright. I will try doing that.

It still doesn’t work, when I try it in roblox itself.

Can i see error logs? Its hard to fix a random issue.

Of course, let me get a screenshot.

It didn’t give me an error, so the output is empty


I obviously touched it. @Znimator

Do you have any errors? What type of script are you using? Is HTTP enabled?

Hello! Thanks for replying.
When I touch my brick, it gives no error.
I am using a local script and yes, HTTP is enabled.

Several things you can do to help debug the problem:

  • Make the part that the touched event is connected to bigger
  • Add print statements for the touched event and when a player is detected
  • Observe what outputs.

Maybe try using a server script, and add debounce so it doesn’t crash your game.

Hello! Thanks for replying.
Alright I will try making it bigger and using the print statements.

Im sorry to ask, but how exactly should I use “debounce”?

Here is a link. Debounce Patterns | Documentation - Roblox Creator Hub.

Example:

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)

When I tried this, my roblox crashed. I think it must work as in studio it gave me the error

exception while signaling: Cannot Teleport in the Roblox Studio.

Does this mean anything good?

It keeps crashing when I try it.