local End = workspace.End
End.Touched:Connect(function(ontouch)
local humanoid = ontouch.Parent:FindFirstChild("Humanoid")
if humanoid then
Wins.Value = Wins.Value +1
humanoid.Position = Vector3.new(8.1, 2.5, 0.2)
end
end)
end)
End.Touched:Connect(function(ontouch)
local humanoid = ontouch.Parent:FindFirstChild("Humanoid")
if humanoid then
Wins.Value = Wins.Value +1
humanoid.Position = Vector3.new(8.1, 2.5, 0.2)
end
end)
end)
change the CFrame
of the characters HumanoidRootPart
ontouch.Parent.HumanoidRootPart.CFrame = CFrame.new(8.1, 2.5, 0.2)
setprimarypartcframe to move the entire character
There are a few issues with this:
CFrame.new(Vector3.new(8.1, 2.5, 0.2)
SetPrimaryPartCFrame is now deprecated, it has been replaced with PivotTo()
Putting these two corrections into practice, you can properly change the characters position by doing:
End.Touched:Connect(function(ontouch)
local humanoid = ontouch.Parent:FindFirstChild("Humanoid")
if ontouch and humanoid then
Wins.Value = Wins.Value +1
ontouch.Parent:PivotTo(CFrame.new(Vector3.new(8.1,2.5,0.2))
end
end)
You should more likely check if game.Players:GetPlayerFromCharacter(ontouch.Parent) == joined or if the instance who touched it has a player to make the Touched Event work better, since ontouch can be an accessory.
But to answer the question, you need the HumanoidRootPart, not the humanoid
Just add an ) at the end of this line
ontouch.Parent:PivotTo(CFrame.new(Vector3.new(8.1,2.5,0.2)))
Apologies for that error
Thanks for your help, much appreciated
false
false
Technically, it does still need a Vector3, but if you don’t use a Vector3 format it will automatically convert it. That is just the way I learned to use CFrame.new
As for the HumanoidRootPart, it makes sense as all of the parts are welded by Motor6d’s (Essentially a weld that allows for animation). I gained the habit of just pivoting the model because not every model is welded.