I recieve the following error when using one of the chat commands in my script
[code][cpp] Error: hook->PlayerSay returned a non-string![/code]
[b]Chat command code:[/b]
[lua]function givePermit(ply)
if (ply:Team() == 2 or ply:Team() == 9 or ply:Team() == 3) then
Notify(ply, 1, 4, "You are legaly permitted to carry a firearm")
elseif (ply:GetNWInt("gunPermit") == 1) then
Notify(ply, 1, 4, "You already own a gun permit.")
return false
else
ply:SetNWInt("gunPermit", (ply:GetNWInt("gunPermit") + 1))
ply:AddMoney(GetGlobalInt("gunpermitcost") * -1)
Notify(ply, 1, 4, "You are now allowed to buy firearms")
end
end
AddChatCommand("/buygunpermit", givePermit)[/lua]
Basically I enter the chat command (in chat) and it will do what it is designed to but just returns that error up the top right. Is there a way to fix this error?
Return "" (an empty string) instead of false.
Still returns the same error.
Show the rest of your code.
That's quite literally it.
Gamemode: DarkRP
File: rplol.lua
Hope this is helpfull enough to help me.
Sorry, you need to Log In to post a reply to this thread.