How to you use click to use TeleportService? for example: ClickDetector and you teleport to a place
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):TeleportToSpawnByName(152842348, "SpawnLocation", player) end end script.Parent.Touched:connect(onTouched)
Take a look at ClickDetector. Instead of using "script.Parent.Touched", which is using the Touched event, you want the MouseClick event:
function onClick(player) game:GetService("TeleportService"):TeleportToSpawnByName(152842348, "SpawnLocation", player) end script.Parent.MouseClick:connect(onClick)