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

Help! Trying to give killer(The Knightmare) a wep?

Asked by 10 years ago

THE WEOPEN IS THE FANG OF ANANSI!

view source 01 function teamFromColor(color) 02 for _,t in pairs(game:GetService("Teams"):GetChildren()) do 03 if t.TeamColor==color then return t end 04 end 05 return nil 06 end 07

08 function onSpawned(plr) 09 local tools = teamFromColor(plr.TeamColor):GetChildren() 10 for _,c in pairs(tools) do 11 c:Clone("Fang Of Anansi").Parent = plr.Backpack 12 end 13 end 14

15 function onChanged(prop,plr) 16 if prop=="Character" then 17 onSpawned(plr) 18 end 19 end 20

21 function onAdded(plr) 22 plr.Changed:connect(function(prop) 23 onChanged(prop,plr) 24 end) 25 end 26

27 game.Players.PlayerAdded:connect(onAdded)

Answer this question