Hello, i was just wondering if there is an easy way to do this since i would have to do this with every other body part, look at the code and the disabled line to understand, yes i know that the disabled line won’t work like i want it to. i just started lua so don’t judge me :P
01 | local p 1 = game.ServerStorage.Nebulea 1 |
02 |
03 | local p 2 = game.ServerStorage.Nebulea 2 |
04 |
05 | local p 3 = game.ServerStorage.Nebulea 3 |
06 |
07 | local p 4 = game.ServerStorage.Nebulea 4 |
08 |
09 | |
10 |
11 | game.Players.PlayerAdded:Connect( function (plr) |
12 |
13 | plr.CharacterAdded:Connect( function (char) |
14 |
15 | local plrP 1 = p 1 :Clone() |
16 |
17 | local plrP 2 = p 2 :Clone() |
18 |
19 | local plrP 3 = p 3 :Clone() |
20 |
21 | local plrP 4 = p 4 :Clone() |
22 |
23 | --plrP1.Parent = char.UpperTorso, char.LowerTorso, char.RightLowerArm, char.LeftLowerArm, char.RightLowerLeg, char.LeftLowerLeg |
24 |
25 | plrP 2. Parent = char.UpperTorso |
26 |
27 | plrP 3. Parent = char.UpperTorso |
28 |
29 | plrP 4. Parent = char.UpperTorso |
30 |
31 | end ) |
32 |
33 | end ) |
Make a for loop that loops though the player's meshparts/bodyparts. This should work:
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | plr.CharacterAdded:Connect( function (chr) |
03 | local p 1 = game.ServerStorage:WaitForChild( "Nebulea1" ) |
04 | local p 2 = game.ServerStorage:WaitForChild( "Nebulea2" ) |
05 | local p 3 = game.ServerStorage:WaitForChild( "Nebulea3" ) |
06 | local p 4 = game.ServerStorage:WaitForChild( "Nebulea4" ) |
07 | local Cp 1 = p 1 :Clone() |
08 | local Cp 2 = p 2 :Clone() |
09 | local Cp 3 = p 3 :Clone() |
10 | local Cp 4 = p 4 :Clone() |
11 | Cp 2. Parent = chr:WaitForChild( "UpperTorso" ) |
12 | Cp 3. Parent = chr.UpperTorso |
13 | Cp 4. Parent = chr.UpperTorso |
14 | for i,v in pairs (chr:GetChildren()) do |
15 | if v:IsA( "MeshPart" ) then |
16 | Cp 1. Parent = v |
17 | end |
18 | end |
19 | end ) |
20 | end ) |
Hope that works. Good luck with our game.