This is kinda killing players when they touch the part.
part = script.Parent
function Touched (char)
char.Position = Vector3.new(10,10,10)
end
script.Parent.Touched:connect(Touched)
This is kinda killing players when they touch the part.
part = script.Parent
function Touched (char)
char.Position = Vector3.new(10,10,10)
end
script.Parent.Touched:connect(Touched)
Try Using the moveto function:
part = script.Parent
cords = 10, 10, 10 -- put cords here
local Human = char.Parent:FindFirstChild("Humanoid")
local Player = char.Parent
function Touched (char)
Player:MoveTo(Vector3.new(cords))
end
script.Parent.Touched:connect(Touched)
Hope i help!
Please accept this answer:
It may have to do with humanoid that you got.
I'll just give you an upvote.
Well, Anything is fine. Thanks a lot :). May you please answer my questions because you are awesome.
Omg so old!
What part of the character are you moving? I would use CFrame on the Torso. That will tp the player to anywhere you want without killing them in the process.
Make the script for me please.
Use :MoveTo()
part = script.Parent
function Touched (char)
char:MoveTo(10,10,10)
end
script.Parent.Touched:connect(Touched)
16:59:42.594 - MoveTo is not a valid member of Part Thats the error
MoveTo Is only for models.
Unfortunately the method you used to move the character unfortunately moved the character's limbs using the Position property, breaking all joints and killing the player's character.
local coords = CFrame.new(0,10,0)
script.Parent.Touched:connect(function(hit)
if hit then
if hit.Parent then
if hit.Parent:FindFirstChild('Humanoid') then
if hit.Parent.Humanoid.Torso then
hit.Parent.Humanoid.Torso.CFrame = coords
end
end
end
end
end)
The above code is meant to teleport a player to the specified coordinates without unexpectedly teleporting them on top of a building if you wanted to teleport them inside. That's the problem with MoveTo() and Position.
I hope you find my answer helpful, I live to help (not really).
This discussion is preserved as it was. New answers, comments, and votes are closed.
8 comments
Does not work
I fixed it though. Thanks :)
There i fixed forgot to include a line.
No problem glad i could help :D
I fixed YOUR script. You did it wrong, you needed the variables in the function
oh, ok i made a mistake, but again, glad i could help :D
stuffs phone cord in variable What? It said cords! D:<
0.o That might work...