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

How do I make this part get destroyed on my death, or come back to me when i respawn?

Asked by 9 years ago

So, I made this cloud that basically levitates and follows me but when I reset, it just stays there and does nothing, like it broke. So, when I die, I want it to come back to me, or get destroyed, thanks!

01b = Vector3.new(0,19,0)
02a = Vector3.new(0,20,0)
03c = Vector3.new(0,10,0)
04puff= game.Workspace.puffscocofeafea.Torso
05humanoid = game.Workspace.puffscocofeafea.Humanoid
06brick = Instance.new("Part", game.Workspace)
07brick.Name = "Float"
08brick.Size = Vector3.new(6, 4.58, 1.57)
09brick.BottomSurface = "Smooth"
10brick.TopSurface = "Smooth"
11puffposition=puff.Position
12 
13mesh = Instance.new("SpecialMesh",brick)
14mesh.Scale = Vector3.new(10,10,10)
View all 31 lines...

1 answer

Log in to vote
1
Answered by
yoshi8080 445 Moderation Voter
9 years ago

Try using this its better to use while wait() do than while true do

01b = Vector3.new(0,19,0)
02a = Vector3.new(0,20,0)
03c = Vector3.new(0,10,0)
04puff= game.Workspace.puffscocofeafea.Torso
05humanoid = game.Workspace.puffscocofeafea.Humanoid
06brick = Instance.new("Part", game.Workspace)
07brick.Name = "Float"
08brick.Size = Vector3.new(6, 4.58, 1.57)
09brick.BottomSurface = "Smooth"
10brick.TopSurface = "Smooth"
11puffposition=puff.Position
12 
13mesh = Instance.new("SpecialMesh",brick)
14mesh.Scale = Vector3.new(10,10,10)
View all 34 lines...

It should remove it when the player dies.

0
Your change in the script canceled out the movement which is "force.position = puff.Position + c" puffscocofeafea 10 — 9y
0
Oh I see yoshi8080 445 — 9y
0
Try that, I should work under one function and it uses the humanoid located up there. yoshi8080 445 — 9y
View all comments (3 more)
0
Thanks, there was an error but I got it and it works, but of the function its only when i lose my health, if I get respawned, it will still be there because I never lost any health. puffscocofeafea 10 — 9y
0
what's that way to check if my humanoid or torso is in my body? is it like "if Torso == nil then brick:destroy()" i know that was wrong but isnt there something like that lol puffscocofeafea 10 — 9y
0
I believe so. I tried your script, but the beginning of the script causes an error for me. yoshi8080 445 — 9y
Ad

Answer this question