Model doesn’t get destroyed using remote function ?
01 | TS.OnServerInvoke = function (player,car,hum,particle,Helmet,costume,copycat,weld) |
04 | local new = Instance.new( "Animation" ) |
05 | new.AnimationId = changeid |
06 | local newtrack = hum:LoadAnimation(new) |
09 | costume = particle:Clone() |
10 | costume.CFrame = car.UpperTorso.CFrame * CFrame.new( 0 , 5 , 0 ) |
11 | costume.Anchored = true |
12 | costume.Parent = car.UpperTorso |
14 | hum:RemoveAccessories() |
15 | copycat = Helmet:Clone() |
16 | copycat.CFrame = car.Head.CFrame * CFrame.new( 0 , 0.75 , 0 ) |
17 | weld = Instance.new( "Weld" ) |
21 | weld.C 0 = car.Head.CFrame:Inverse() |
22 | weld.C 1 = copycat.CFrame:Inverse() |
23 | copycat.Parent = game.Workspace |
33 | TC.OnServerInvoke = function (player,car,hum,particle,Helmet,costume,copycat,weld,empty,ShirtId,Pants) |
36 | local Debris = game:GetService( "Debris" ) |
37 | local new = Instance.new( "Animation" ) |
38 | new.AnimationId = changeid |
39 | local newtrack = hum:LoadAnimation(new) |
42 | costume = particle:Clone() |
43 | costume.CFrame = car.UpperTorso.CFrame * CFrame.new( 0 , 5 , 0 ) |
44 | costume.Anchored = true |
45 | costume.Parent = car.UpperTorso |
47 | Debris:AddItem(copycat) |
49 | car.Shirt.ShirtTemplate = ShirtId |
50 | car.Pants.PantsTemplate = Pants |
So, I tried destroying a model in a remote function, but it didn’t work. I used Debris and Destroy and returned the function. Any idea ?