Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why am i not getting not getting teleported when i click the button? [SOLVED]

Asked by 5 years ago
Edited 5 years ago

Im trying to teleport the player when they click the button but it's not working any help?

code:

script.Parent.MouseButton1Click:Connect(function()

game.Players.LocalPlayer.Character.LowerTorso.CFrame = CFrame.new(workspace.Part.Position)

end)
0
if u have multiple parts in workspace called part then it cant teleport you because there are multiple positions that it wants to teleport you to, make the part name something special Gameplayer365247v2 1055 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

I am certain that your script works:

script.Parent.MouseButton1Click:Connect(function() 

game.Players.LocalPlayer.Character.LowerTorso.CFrame = CFrame.new(workspace.Part.Position)

end)

Please check if you are using a LocalScript which is under the textbutton since specified in the first line which isscript.Parent.MouseButton1Click:Connect(function() And also check if your Using R15 specified in the 3rd line game.Players.LocalPlayer.Character.LowerTorso.CFrame whilst R15 having LowerTorso(s). And lastly, make sure your Part exists in the workspace!

Ad
Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Try to rename your part to a specify name.

script.Parent.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.Character.LowerTorso.CFrame =
CFrame.new(game.Workspace.name.Position)
end)

I think that should work for you. Also, don`t forget to change line 3 name to a name with which you renamed your part.

0
mariofl2003 CFrame is not a valid member of model..?? Freddan2006YT 88 — 5y
0
this thread is marked as 'answered', and I see no accepted answer. Did you already found a way to fix it? NickAtNick 163 — 5y

Answer this question