Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

MoveTo not changing model's PrimaryPart position?

game.ReplicatedStorage.Remotes.Moves.BoneCrush.Effects.OnServerEvent:connect(function(player)
	player.PlayerScripts.ControlScript.Disabled = true
	local it = game.ServerStorage.Instant_Transmission
	it:Clone().Parent = workspace
	it:MoveTo(Vector3.new(-0, 3, -18))
	game.ReplicatedStorage.Remotes.Moves.BoneCrush.Player:FireAllClients(player)
end)

originally I made MoveTo(player.Character.HumanoidRootPart.Position) and it didn't work.

the model just always stays in the same position and I set the primarypart already

1 answer

✓ Accepted answer

When you are using MoveTo for it, it doesn't move the cloned version but instead the original one in storage. To fix this, you can create a variable for the cloned it:

game.ReplicatedStorage.Remotes.Moves.BoneCrush.Effects.OnServerEvent:connect(function(player)
    player.PlayerScripts.ControlScript.Disabled = true
    local it = game.ServerStorage.Instant_Transmission
	local cloned = it:Clone()
    cloned.Parent = workspace
    cloned:MoveTo(Vector3.new(-0, 3, -18))
    game.ReplicatedStorage.Remotes.Moves.BoneCrush.Player:FireAllClients(player)
end)

1 comment

0

I sat here at work for 20 minutes staring down his code but kept overlooking this lol. Probably because it was 7 am and I had no caffeine yet. Good look tho, upvote

This discussion is preserved as it was. New answers, comments, and votes are closed.