function onJoinChannel(cid, channel, users)
if channel == 11 then
doPlayerSendToChannel(0, cid, TALKTYPE_CHANNEL_W, 'Welcome '.. getCreatureName(cid) ..'!', 11)
end
return true
end
function onSay(cid, words, param, channel)
if channel == 11 then
doPlayerSendToChannel(0, cid, TALKTYPE_CHANNEL_W, 'The skills are: ...', 11)
end
return true
end
if (msgcontains(msg, 'skills')
[12/05/2011 19:53:27] [Error - CreatureScript Interface]
[12/05/2011 19:53:27] data/creaturescripts/scripts/xxx.lua
[12/05/2011 19:53:27] Description:
[12/05/2011 19:53:27] data/creaturescripts/scripts/talentcha.lua:12: attempt to call global 'msgcontains' (a nil value)
[12/05/2011 19:53:27] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/xxx.lua)
function msgcontains(message, keyword)
if(type(keyword) == "table") then
return table.isStrIn(keyword, message)
end
local a, b = message:lower():find(keyword:lower())
if(a ~= nil and b ~= nil) then
return true
end
return false
end
function sendMessage(cid, message)
return doPlayerSendChannelMessage(cid, "", message, TALKTYPE_CHANNEL_O, 11)
end
function onJoinChannel(cid, channel, users)
if channel == 11 then
return addEvent(sendMessage, 100, cid, "[Talent Channel] Welcome, ".. getPlayerName(cid) ..", here you can upgrade your skills with talent points by saying, 'Skills'.")
end
return true
end
if(msgcontains(message, 'skills')) then
doCreatureSay(cid, "lol")
return true
end
function onLeaveChannel (cid, channel, users)
if channel == 11 then
return onLogout(cid)
end
return true
end
[12/05/2011 20:24:53] [Error - CreatureScript Interface]
[12/05/2011 20:24:53] data/creaturescripts/scripts/talentcha.lua
[12/05/2011 20:24:53] Description:
[12/05/2011 20:24:53] data/lib/050-function.lua:826: attempt to index local 'message' (a nil value)
[12/05/2011 20:24:53] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/talentcha.lua)
function onSay(cid, words, param, channel)
if channel == 11 and words == "skills" then
doPlayerSendToChannel(0, cid, TALKTYPE_CHANNEL_W, 'The skills are: ...', 11)
end
return true
end
function onSay(cid, words, param, channel)
if channel == 11 then
doPlayerSendToChannel(0, cid, TALKTYPE_CHANNEL_W, 'The skills are: ...', 11)
end
return true
end
<talkaction log="yes" words="skills" event="script" value="skills.lua"/>
function onSay(cid, words, param, channel)
if channel == 11 then
if getPlayerStorageValue(cid, 2191, -1) then
if getPlayerStorageValue(cid, 2115) >= 1 then
setPlayerStorageValue(cid, 2191, 1)
setPlayerStorageValue(cid, 2115, getPlayerStorageValue(cid,2115)-1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+50)
doPlayerSendChannelMessage(cid, 0, "You just used talent points for Extra Health.", TALKTYPE_CHANNEL_W, 11)
return true
else
doPlayerSendChannelMessage(cid, 0, "Not enough talent points (1).", TALKTYPE_CHANNEL_W, 11)
return true
end
end
end
end
<talkaction words="extra health" hide="yes" event="script" value="talentskills.lua"/>
filter="word-spaced"