I made a quick teleport script for my game. If you click it, you get teleported to another place. My problem is that it doesn’t work. I tried making it print something so I can test it in studio, but it doesn’t do it. Can someone check what’s wrong with my code?
local TeleportService = game:GetService("TeleportService")
local part = script.Parent
local clickDetector = part.ClickDetector
function onMouseClick(hit)
local char = hit.Parent
local player = game.Players:GetPlayerFromCharacter(char)
print("clickedYeah")
TeleportService:Teleport(5181582210, player)
print("clickedYeah")
end