I made a script and asked script helping about it which I got that one answered about using clickdetector to teleport. But it didn't work since there was a error. This is the script and error:
Script:
s = game:service("TeleportService") id = 74232401 function onClicked(player) s:Teleport(id,player) end script.Parent.ClickDetector:connect(onClicked)
Error:
01:22:20.692 - connect is not a valid member of ClickDetector
Please help. Thank you, benthekarateboy :D
Errors:
No such method as :service()
for game
. Use game:GetService("TeleportService")
instead.
:connect()
is a method for events, not an object. The conventional formula for a connection line is:
[Event]:connect([function])
Thus:
script.Parent.ClickDetector.MouseClick:connect(onClicked)