Hey guys, here's my script.
1 | while true do |
2 | shed = game.ServerStorage.Shedletsky:Clone() |
3 | shed.Parent = game.Workspace |
4 | shed:MoveTo(Vector 3. new(math.random(- 512 , 512 ), math.random( 50 , 325 ), math.random(- 512 , 512 ))) |
5 | --game:GetService("Debris"):AddItem(shed, 5) |
6 | wait( 1 ) |
7 | end |
Things are pretty straight-forward, except Shedletsky keeps dying when I move him. i don't get any errors. You can test this by inserting a NPC with a humanoid into ServerStorage and naming it Shedletsky.
You need to use :MakeJoints()
to keep the character together:
1 | while true do |
2 | shed = game.ServerStorage.Shedletsky:Clone() |
3 | shed.Parent = game.Workspace |
4 | shed:MakeJoints() |
5 | shed:MoveTo(Vector 3. new(math.random(- 512 , 512 ), math.random( 50 , 325 ), math.random(- 512 , 512 ))) |
6 | --game:GetService("Debris"):AddItem(shed, 5) |
7 | wait( 1 ) |
8 | end |