gpt-4-0314· OpenAI
WildChat-4.8M (AI2)
fivem lua RegisterCommand("testing", function(score) print(score)…
- User
fivem lua
RegisterCommand("testing", function(score) print(score) TriggerClientEvent("qb-nui:update-score", -1, score) end)
for some reason when i enter /testing 5 or /testing "0-5" it always prints 0
- Assistant
The issue is that you're not correctly handling arguments passed to the registered command. To fix it, replace:
RegisterCommand("testing", function(score)with:
RegisterCommand("testing", function(source, args) local score = args[1]Here is the updated code:
RegisterCommand("testing", function(source, args) local score = args[1] print(score) TriggerClientEvent("qb-nui:update-score", -1, score) end)Now, when you enter
/testing 5or/testing "0-5", it should properly print the correct score.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.