• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

cursed system

HamTheKratos

Member
Joined
Jan 14, 2009
Messages
243
Reaction score
8
Location
I Dunno
My First Script ^^

command to add or remove curse:
LUA:
function onSay(cid,words,param)

local requiredGroup = 3

local curStorageValue = 11111

local target = getPlayerByName(param)

	if words == '/addcur' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, curStorageValue) == -1 then 
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, curStorageValue, 1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now CURSED'..adminName..'Cursed You.') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You Cursed "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't CURSE anyone.")
			
		elseif getPlayerStorageValue(target, curStorageValue) ~= -1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already CURSED.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
		

	elseif words == '/takecur' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, curStorageValue) == 1 then
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, curStorageValue, -1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' Removed your CURSE') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed the CURSE of "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove CURSE of anyone.")
			
		elseif getPlayerStorageValue(target, curStorageValue) ~= 1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not CURSED.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
end		
end

Effect on curse player
data/creaturescripts/scripts/curse.lua

LUA:
  local timeEffect = 60 -- Seconds for effects
local status = 11111 -- Storage for curse
local playercur = getPlayerStorageValue(cid, status)
function onLogin(cid)
    if getPlayerStorageValue(cid, status) == TRUE then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "CURSED PLAYER")
        addEvent(special, timeEffect * 1000)
    end
    return TRUE
end

local function special()
    if playercur == TRUE then
        doSendAnimatedText(getCreaturePosition(cid), "CURSED!", TEXTCOLOR_RED)
doPlayerAddHealth(cid,-1000)
doPlayerAddMana(cid, -1000)
    end
end


GUYS IT IS MY FIRST SCRIPT.
comment&rep please
 
Last edited:
Please use code tags to improve neatness. And also your script is bugged due to you having a Space error
LUA:
INFO: Starting OTScript Debug.lua
ERROR: untitled.lua:15: unfinished string near ''You are now a CURSE'
INFO: Stopping OTScript Debug.lua

You have:
PHP:
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a CURSE
'..adminName..' gave you the V.I.P.')

Just backspace it

PHP:
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a CURSE'..adminName..' gave you the V.I.P.')
 
you can click edit and change them =p to use it do

[-LUA]
[/-LUA]

Without the Dash's
 
Back
Top