hi i made this script, it's inside a textbox from a screengui :
local i = script.Parent local map = game.Workspace.Map1.sa function onButtonClicked() local plr = game.Players.LocalPlayer plr.Position = map.Position end i.MouseButton1Down:connect(onButtonClicked)
idk is wrong with it :/ Please help, any help at all will be greatly appreciated
1st Problem is that you placed the code in a script
, should be a LocalScript
.
2nd Problem is line 05
you are positioning a Player
, You should access the Player
's Character, then Position it by it's Torso
or Position the Model itself by using the MoveTo
Method.
local i=script.Parent local map=workspace.Map1.sa function onButtonClicked() local plr=game.Players.LocalPlayer local character=plr.Character character:MoveTo(map.Position) end i.MouseButton1Down:connect(onButtonClicked)