Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local speciesAllowed = {}
- speciesAllowed["husk"] = true
- speciesAllowed["yourOtherSpeciesHere"] = true
- Hook.Add("chatMessage","controlhuskcommand",function(msg, client)
- if msg == "!controlhusk" then
- if client.Character ~= nil then
- if not client.Character.IsDead then
- return true
- end
- end
- if not client.InGame then
- return true
- end
- local chars = Character.CharacterList
- local suitablechars = {}
- for i = 1, #chars, 1 do
- local charat = chars[i]
- if not charat.IsDead and speciesAllowed[charat.SpeciesName] and not charat.IsRemotelyControlled then
- table.insert(suitablechars, charat)
- end
- end
- if #suitablechars >= 1 then
- Player.SetClientCharacter(client, suitablechars[Random.Range(1, #suitablechars)])
- end
- return true -- hide message
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement