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

MoveTo not changing model's PrimaryPart position?

Asked by 6 years ago
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

Log in to vote
1
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

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)
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 Legoman654 100 — 6y
Ad

Answer this question