I have a script using the Player.ConCommand function, but it isn’t behaving consistently.
I ran the script on a listen server and both Player.ConCommand and the console command itself worked just fine. However, I loaded it onto my server and Player.ConCommand stopped working properly (or, at least, as it had been working). Now the function no longer executes the console command. You can, however, execute the console command by typing it in. The script worked on the listen server, but now only manually typing in the console command runs the target function.
Does anyone know the issue?
Here’s the code:
ply.bistar.freq = string.sub(text,6) ply:ChatPrint("(Frequency changed to: "..string.sub(text,6).. ")") ply:ConCommand("bistar_rp_updatefreq") // <-- THE ISSUE else for k,v in pairs(player.GetAll()) do if (ply.bistar.freq) == v.bistar.freq then v:ChatPrint("RADIO["..tostring(ply.bistar.freq).."]: "..text) end end end[/lua]
As I said, the entire script ‘works,’ but it never really calls that command. I can type “bistar_rp_updatefreq” in and it works.