Aleada
Unknown Member
- Joined
- Mar 14, 2013
- Messages
- 231
- Reaction score
- 7
Hey everyone, I'm trying to make it so when you kill a "Boss" you get 1 reputation point... It works randomly like once... and then it just doesn't work.
I'm not even getting any errors in the console... but here's my script:
RepBoss.lua (Got this from http://otland.net/f82/epic-daily-missions-tasks-mod-185352/)
Creaturescripts.xml
Login.lua
And on the monsters (Bosses)
Thank you everyone! I will REP you for helping!
I'm not even getting any errors in the console... but here's my script:
RepBoss.lua (Got this from http://otland.net/f82/epic-daily-missions-tasks-mod-185352/)
PHP:
local config = {
{["name"] = "testboss"},
{["name"] = "testbosstwo"}
}
function onKill(cid, target)
if(isPlayer(target) ~= TRUE) then
local master = getCreatureMaster(target)
if(master and master ~= target) then return TRUE end
for i = 1, #config do
if getCreatureName(target):lower() == config[i].name:lower() then
db.executeQuery("UPDATE `players` SET `rep` = `rep` + 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
doCreatureSay(cid, 'Congratulations, you have killed '..getCreatureName(target)..'! You have received some reputation.', TALKTYPE_ORANGE_1, false, cid)
end
end
end
return TRUE
end
Creaturescripts.xml
PHP:
<event type="kill" name="RepBoss" event="script" value="RepBoss.lua"/>
Login.lua
PHP:
registerCreatureEvent(cid, "RepBoss")
And on the monsters (Bosses)
PHP:
<script>
<event name="RepBoss"/>
</script>
Thank you everyone! I will REP you for helping!