i want to teleport a player after he clixks the button this is my script
script.parent.MouseButto1Click:Connect(function(player)
player.Torso.CFrame = CFrame.new (--Position)
end)
i want to teleport a player after he clixks the button this is my script
script.parent.MouseButto1Click:Connect(function(player)
player.Torso.CFrame = CFrame.new (--Position)
end)
Yo Try to use this script If your button is in startergui, then add the localscript inside button then use this script
local player = game.Players.LocalPlayer
script.parent.MouseButton1Click:Connect(function()
player.Character.HumanoidRootPart.CFrame = CFrame.new(--position)
end)
but if it on the part I recommend to use clickdetector, insert this script to clickdetector
script.Parent.MouseClick:Connect(function(plr)
plr.Character.HumanoidRootPart.CFrame = CFrame.new(--position)
end)
I hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.