• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script Simple

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
i would like a talkaction for gods give points to player.

here function

Code:
doAddPoints(cid, points)

Code:
/addpoints Name Player,points
 
Last edited:
LUA:
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[2] = tonumber(t[2])
        if(not t[2]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[1]) then
                pid = getPlayerByNameWildcard(t[1])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
                        return true
                end
        end
 
 
    doAddPoints(pid, t[2])
    doPlayerSendTextMessage(cid, "You have added ".. t[2] .." points to ".. t[1])
        return true
end
 
Last edited:
Code:
[2:26:22.140] [Error - TalkAction Interface]
[2:26:22.140] data/talkactions/scripts/addpoint.lua:onSay
[2:26:22.140] Description:
[2:26:22.140] (luaDoPlayerSendTextMessage) Player not found

[2:26:22.140] [Error - TalkAction Interface]
[2:26:22.140] data/talkactions/scripts/addpoint.lua:onSay
[2:26:22.140] Description:
[2:26:22.140] data/talkactions/scripts/addpoint.lua:27: attempt to concatenate g
lobal 'sender' (a nil value)
[2:26:22.140] stack traceback:
[2:26:22.140]   data/talkactions/scripts/addpoint.lua:27: in function <data/talk
actions/scripts/addpoint.lua:1>
 
Back
Top