India Posted February 4, 2021 Share Posted February 4, 2021 Ped stats changing by command, i want it when resource started, how can i? can anyone help commandName = "defaultstats" addCommandHandler (commandName, function(sot) setPedStat (sot, 22, 0) setPedStat (sot, 23, 0) outputChatBox("Stats Changed To Default!", sot, 255, 0, 0) end ) Link to comment
SpecT Posted February 4, 2021 Share Posted February 4, 2021 Hello, I assume that this code is meant to be server-sided then this should do the work: function onStartSetStats() for i, player in pairs (getElementsByType("player")) do setPedStat (player, 22, 0) setPedStat (player, 23, 0) outputChatBox("Stats Changed To Default!", player, 255, 0, 0) end end addEventHandler("onResourceStart",resourceRoot,onStartSetStats) 1 Link to comment
India Posted February 4, 2021 Author Share Posted February 4, 2021 1 hour ago, SpecT said: Hello, I assume that this code is meant to be server-sided then this should do the work: function onStartSetStats() for i, player in pairs (getElementsByType("player")) do setPedStat (player, 22, 0) setPedStat (player, 23, 0) outputChatBox("Stats Changed To Default!", player, 255, 0, 0) end end addEventHandler("onResourceStart",resourceRoot,onStartSetStats) Its work. Thank you so much for your help and for your time 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now