Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Click Teleport Won't Work In Online Game, How Do i Fix It?

This is how the script Looks like:

function onClicked()
wait(1)
local c = game.Players:GetChildren() 
for i = 1, #c do 
c[i].Character.Torso.CFrame = CFrame.new(game.Workspace.Locker1Teleporter.GG.Position)
end 

end 

game.Workspace.Locker1Teleporter.TeleportG.ClickDetector.MouseClick:connect(onClicked)

I HAVE TRIED: -- "parent.parent" method ect and it did not work. -- F9 on Online, Console said NOTHING :o -- Changing the "Parent" into a longer version, as seen above.

Here is how it originaly looked like:

function onClicked()
wait(1)
local c = game.Players:GetChildren() 
for i = 1, #c do 
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.GG.Position)
end 

end 

script.Parent.TeleportG.ClickDetector.MouseClick:connect(onClicked)

What i have made is so that if you click on the "Locker" as ive created you will be teleported "Inside" of it, it worked in "Play Solo" but NOT in Server.

Here is the game: http://www.roblox.com/Escape-place?id=184349084

So, any tips or fixes? The answear might be easy visible but im kindoff new to Scripting. (Allso im new to the ScriptHelper Community) ~ THANKS ~

1 answer

✓ Accepted answer

Strange, for me the second one worked in an online game...

If you spawned in the room with the lockers then the reason was the range is too much and its not activating

4 comments

0

Nope, ive tryed the MaxActivationDistance from 10 -> 60, still wont work.

0

Just to mention, this script runs in a Normal Basic Script INSIDE of a Model. The Model Has the objects that you click and to the brick you will be teleported to. Again, Works Solo Test, But not in Online Server...

0

Allso remember that this game uses a 2D camera type of view, So i need to keep the click distance in view of the camera placement.

0

I Fixed It, Had To Have It In A Local Script.

This discussion is preserved as it was. New answers, comments, and votes are closed.