• 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!

Creature Script Doesnt Work!!! :(!

lol94

Loler
Joined
Dec 23, 2008
Messages
764
Reaction score
55
Location
Mexico
hello Otland, i got this script.. but doesnt work on my server... the point is if i kill a player... i get a crystal coin... so.. i dont know whats wrong with this!!

Frage Reward

Code:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
        loot = 2160 
      item = doPlayerAddItem(cid,loot,1)
    elseif getPlayerName(cid) == getPlayerName(target) then
      doPlayerAddItem(cid,loot,1)
else
        doPlayerAddExperience(cid, -1000000)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
        end
end
        return TRUE
end

If you helpme i will REP++!! you as hell!!!
 
Your script is wrong in so many places, I just started from scratch. Post any errors

Code:
function onDeath(cid, corpse, deathList)
if isPlayer(target) == TRUE then) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doAddContainerItem(corpse.uid, 2160, 1)
elseif getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
return true
end
end
 
wtf

[08/09/2010 19:32:39] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/fragreward.lua:2: unexpected symbol near ')'
[08/09/2010 19:32:39] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/fragreward.lua)
[08/09/2010 19:32:39] data/creaturescripts/scripts/fragreward.lua:2: unexpected symbol near ')
 
Code:
function onDeath(cid, corpse, deathList)
if isPlayer(target) == TRUE then then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doAddContainerItem(corpse.uid, 2160, 1)
elseif getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
return true
end
end
 
sorry :S

[08/09/2010 20:27:10] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/fragreward.lua:2: unexpected symbol near 'then'
[08/09/2010 20:27:10] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/fragreward.lua)
[08/09/2010 20:27:10] data/creaturescripts/scripts/fragreward.lua:2: unexpected symbol near 'then'

still same
 
man you can't read? not hard to fix these yourself

Code:
function onDeath(cid, corpse, deathList)
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doAddContainerItem(corpse.uid, 2160, 1)
elseif getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
return true
end
end
 
Code:
[08/09/2010 20:27:10] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/fragreward.lua:2: unexpected symbol near 'then'

"fragreward.lua:2" shows the script, and what line of the script the error is on. unexpected symbol near 'then' means there is something wrong near the word "then", in that case there was an extra then there because i was in a hurry
 
LUA:
function onKill(cid, target, lastHit)
	if isPlayer(target) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
			doAddContainerItem(corpse.uid, 2160, 1)
		elseif getPlayerIp(cid) == getPlayerIp(target) then
			doPlayerAddExperience(cid, -1000000)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
		end
	end
	return true
end
 
Back
Top