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

My first script dont work :S

Kaorus

Unleash Dreams Staff
Joined
May 18, 2008
Messages
1,111
Reaction score
41
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local teleport = {x=79, y=97, z=6}
local pos = getCreaturePosition(cid)
if item.itemid == 9825 and getPlayerAccess(cid) >= 4 then
        doPlayerSendTextMessage(cid,21,"You are a staff member, you can pass")
        doTeleportThing(cid, teleport, TRUE)
        doSendMagicEffect(pos, 10)
        doSendMagicEffect(teleport, 10)
else        
        doPlayerSendCancel(cid,"You dont are member of the staff.")
        end
elseif item.itemid == 9826 and getPlayerAccess(cid) >= 4 then
        doPlayerSendTextMessage(cid,21,"You are a staff member, you can pass")
        doTeleportThing(cid, teleport, TRUE)
        doSendMagicEffect(pos, 10)
        doSendMagicEffect(teleport, 10)
else        
        doPlayerSendCancel(cid,"You dont are member of the staff.")
        end
        return true
end
Someone can fix?

PD:
Please, say the error of the scripts
 
Does your server give you any errors when you try to run your script?

You can try changing

PHP:
        doTeleportThing(cid, teleport, TRUE)

to

PHP:
        doTeleportThing(cid, teleport)
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local teleport = {x=79, y=97, z=6}
local pos = getCreaturePosition(cid)
	if item.itemid == 9825 and getPlayerAccess(cid) >= 4 then
        doPlayerSendTextMessage(cid,21,"You are a staff member, you can pass")
        doTeleportThing(cid, teleport, TRUE)
        doSendMagicEffect(pos, 10)
        doSendMagicEffect(teleport, 10)
	elseif item.itemid == 9826 and getPlayerAccess(cid) >= 4 then
        doPlayerSendTextMessage(cid,21,"You are a staff member, you can pass")
        doTeleportThing(cid, teleport, TRUE)
        doSendMagicEffect(pos, 10)
        doSendMagicEffect(teleport, 10)
	else        
        doPlayerSendCancel(cid,"You dont are member of the staff.")
	end
return true
end

Fixed :D
 
Back
Top