Parts always teleport to 0,0,0?

this is the script inside a textbox:

script.Parent.MouseButton1Click:Connect(function()
	if game.Players.LocalPlayer.Name == "sussy_bacoo" then
		local player = game.Players.LocalPlayer
		local pos = player.Character.Torso.Position
		local textBox = script.Parent.Parent.TextBox
		local text = textBox.Text
		local event = game.ReplicatedStorage.Bring
		event:FireServer(text, pos)
		print(pos)
	end
end)

and this is the script inside the part:

local event = game.ReplicatedStorage.Bring
event.OnServerEvent:Connect(function(plr,name,pos)
	if script.Parent.Plr.Value == name or name == "all" then
		script.Parent.Position = script.Parent.Vector3.new(pos)
		script.Parent.Anchored = true
	end
end)
1 Like

The script inside of the part should be this:

local event = game.ReplicatedStorage.Bring
event.OnServerEvent:Connect(function(plr,name,pos)
	if script.Parent.Plr.Value == name or name == "all" then
		script.Parent.Position = pos
		script.Parent.Anchored = true
	end
end)

Since pos is already a vector 3, then you don’t need to include Vector3.new.
But also, if you were, you would still need to do part.Position = Vector3.new(x, y, z)

.Position is already a vector 3 so the code above should work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.