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

Model doesn’t get destroyed using remote function ?

Asked by
eyad27 8
4 years ago

TS.OnServerInvoke = function(player,car,hum,particle,Helmet,costume,copycat,weld) hum.WalkSpeed = 0 wait(0.5) local new = Instance.new("Animation") new.AnimationId = changeid local newtrack = hum:LoadAnimation(new) newtrack:Play() wait(1) costume = particle:Clone() costume.CFrame = car.UpperTorso.CFrame * CFrame.new(0,5,0) costume.Anchored = true costume.Parent = car.UpperTorso wait(1) hum:RemoveAccessories() copycat = Helmet:Clone() copycat.CFrame = car.Head.CFrame * CFrame.new(0,0.75,0) weld = Instance.new("Weld") weld.Parent = copycat weld.Part0 = car.Head weld.Part1 = copycat weld.C0 = car.Head.CFrame:Inverse() weld.C1 = copycat.CFrame:Inverse() copycat.Parent = game.Workspace car.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=53557909" car.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=53558597" wait(1) hum.WalkSpeed = 16 costume:Destroy() new:Destroy() return copycat,weld end TC.OnServerInvoke = function(player,car,hum,particle,Helmet,costume,copycat,weld,empty,ShirtId,Pants) hum.WalkSpeed = 0 wait(0.5) local Debris = game:GetService("Debris") local new = Instance.new("Animation") new.AnimationId = changeid local newtrack = hum:LoadAnimation(new) newtrack:Play() wait(1) costume = particle:Clone() costume.CFrame = car.UpperTorso.CFrame * CFrame.new(0,5,0) costume.Anchored = true costume.Parent = car.UpperTorso wait(1) Debris:AddItem(copycat) Debris:AddItem(weld) car.Shirt.ShirtTemplate = ShirtId car.Pants.PantsTemplate = Pants wait(1) hum.WalkSpeed = 16 costume:Destroy() new:Destroy() return copycat,weld end

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 ?

0
connect functions matiss112233 258 — 4y
0
How do I connect it ? eyad27 8 — 4y

1 answer

Log in to vote
0
Answered by
Necro_las 412 Moderation Voter
4 years ago

Maybe is because of your invoke method. Try using instead of

TS.OnServerInvoke = 
function()

write

local function function_name(player and etc)
    -- etc
end

TS.OnServerInvoke = function_name
0
Is that in the local script eyad27 8 — 4y
0
No, on server script. If you use OnServerInvoke it has to be in server script, otherwise is OnClentInvoke Necro_las 412 — 4y
0
err i dont think that works, i think u shoudl connect Erie20 102 — 4y
0
How ? Mind giving an example ? eyad27 8 — 4y
0
what did you put in the local script @eyad27 ? Necro_las 412 — 4y
Ad

Answer this question