So, I'm trying to make a chat command from SAMP which writes if players /me command is failed or success. At this moment I got this simple script https://pastebin.com/8KKP1x1F which doesn't work ;c
It gives console error everytime I write /try command
[ERROR] addons/trycommand/lua/darkrp_modules/try_cmd/sv_try.lua:20: attempt to index upvalue 'random' (a number value)
1. DoSayFunc - addons/trycommand/lua/darkrp_modules/try_cmd/sv_try.lua:20
2. unknown - gamemodes/darkrp/gamemode/modules/chat/sv_chat.lua:150
Any ideas how to fix it?
"random" is a number, not a table, so you cannot index random.result. As another note, you only generate the random number once at the top of the file so it will never change.
Sorry, you need to Log In to post a reply to this thread.