Hey guys,
I was just working on a boss battle that teleports you to another game when you touch a secret door. But the problem is, the touched event needs to be in a serverscript and the teleportservice needs to be in a localscript. What do I do?
Here is my code:
local teleportservice = game:GetService("TeleportService") script.Parent.Touched:Connect(function() teleportservice:Teleport(5190764174) end)
Thanks.
local teleportservice = game:GetService("TeleportService") script.Parent.Touched:Connect(function(hit) if game.Players:FindFirstChild(hit.Parent.Name) then local plr = game.Players:FindFirstChild(hit.Parent.Name) teleportservice:Teleport(plr,5190764174) end end)
Lol.