-- iLegimate -- -- Functions -- function choseASSASIN() if game.Players.NumPlayers>0 then local chosen=game.Players:GetPlayers()[math.random(1,game.Players.NumPlayers)] chosen.Character.Humanoid.MaxHealth = 2000 chosen.Character.Humanoid.Health = 2000 chosen.Character.Humanoid.WalkSpeed = 20 -- ADD THE SHIRT TEMPLATE AND PANTS TEMPLATE (BELOW) -- if chosen.Character:findFirstChild("Shirt") then chosen.Character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=169491383" else s = Instance.new("Shirt", chosen.Character) s.ShirtTemplate = "http://www.roblox.com/asset/?id=169491383" end if chosen.Character:findFirstChild("Pants") then chosen.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" else p = Instance.new("Pants", chosen.Character) p.Name = "Pants" p.PantsTemplate = "http://www.roblox.com/asset/?id=" end end end wait(5) choseASSASIN()
It works in test solo,But when i start a server it doesnt work at all. Please help.
You're assuming that the player's Character is not nil and the Character has a Humanoid. You should be using WaitForChild.
This script will most likely run before any players join the game. The server exists usually for 10-15 seconds before a player gets the chance to join. If that happens, of course it won't work.
Try something like this on line 7:
while game.Players.NumPlayers < 1 do game.Players.PlayerAdded:wait() end