Spawn avec objet aléatoire

  • Initiateur de la discussion
aninimox

aninimox

Geek suprême
Messages
417
Score réaction
78
Points
140
Bonjour,

j'ai réussi a faire spawn mes objets aléatoire quand je spawn donc voici ce que j'ai fait.

Code:
local CitoyenWeapons = { "pass_civ", "pass_jui" }
TEAM_CITOYEN = DarkRP.createJob("Citoyen", { color = Color(10, 127, 13, 255), model = { "models/player/suits/male_02_closed_coat_tie.mdl", "models/player/suits/male_02_closed_tie.mdl", "models/player/suits/male_02_open.mdl", "models/player/suits/male_02_open_tie.mdl", "models/player/suits/male_02_open_waistcoat.mdl", "models/player/suits/male_02_shirt.mdl", "models/player/suits/male_02_shirt_tie.mdl", "models/player/suits/male_04_closed_coat_tie.mdl", "models/player/suits/male_04_closed_tie.mdl", "models/player/suits/male_04_open.mdl", "models/player/suits/male_04_open_tie.mdl", "models/player/suits/male_04_open_waistcoat.mdl", "models/player/suits/male_04_shirt.mdl", "models/player/suits/male_04_shirt_tie.mdl", "models/player/suits/male_06_closed_coat_tie.mdl", "models/player/suits/male_06_open.mdl", "models/player/suits/male_06_closed_tie.mdl", "models/player/suits/male_06_open_tie.mdl", "models/player/suits/male_06_open_waistcoat.mdl", "models/player/suits/male_06_shirt.mdl", "models/player/suits/male_06_shirt_tie.mdl", "models/player/suits/male_07_closed_coat_tie.mdl", "models/player/suits/male_07_closed_tie.mdl", "models/player/suits/male_07_open.mdl", "models/player/suits/male_07_open_tie.mdl", "models/player/suits/male_07_open_waistcoat.mdl", "models/player/suits/male_07_shirt.mdl", "models/player/suits/male_07_shirt_tie.mdl", "models/player/suits/male_08_closed_coat_tie.mdl", "models/player/suits/male_08_closed_tie.mdl", "models/player/suits/male_08_open.mdl", "models/player/suits/male_08_open_tie.mdl", "models/player/suits/male_08_open_waistcoat.mdl", "models/player/suits/male_08_shirt.mdl", "models/player/suits/male_08_shirt_tie.mdl", "models/player/suits/male_09_closed_coat_tie.mdl", "models/player/suits/male_09_closed_tie.mdl", "models/player/suits/male_09_open.mdl", "models/player/suits/male_09_open_tie.mdl", "models/player/suits/male_09_open_waistcoat.mdl", "models/player/suits/male_09_shirt.mdl", "models/player/suits/male_09_shirt_tie.mdl" }, description = [[Vous etes un citoyen.]], weapons = {"weapon_fists", "keys", "wallet", "itemstore_pickup"}, command = "Citoyen", max = 0, salary = 10, admin = 0, vote = false, hasLicense = false, candemote = false, PlayerSpawn = function(ply) ply:Give( table.Random( CitoyenWeapons ) ) end, OnPlayerChangedTeam = function(ply, oldTeam, newTeam) if CLIENT then return end if newTeam == TEAM_CITOYEN then ply:Give( table.Random( CitoyenWeapons ) ) end end
})
Donc je spawn bien avec sois un pass_civ ou pass_jui mais quand je change dé métier et que je redevient Citoyen il ne me le spawn plus :/
Alors j'ai fait un OnPlayerChangedTeam mais sa marque que cela me le give mais quand je check mes weapons je l'ai plus :/
 
Discord d'entraide
Rejoignz-nous sur Discord