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

Reward script

Na Amigo

The crazy girl
Joined
Jun 5, 2017
Messages
254
Solutions
3
Reaction score
18
Location
Egypt
i'v write this script but it's not working i want someone correct it
Code:
<action itemid="2295" script="reward.lua" />
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
voc = get player
if voc = 5 then
doplayer additem{item=3966, count=1}, -- Staff
doplayer additem{item=2275, count=1}, -- Mana
doplayer additem add level 700

doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)
return true
else
end
end
 
Solution
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

    -- "get player" is not a real function. Try searching for getPlayerVocation
    voc = get player
  
    -- need to use == to compare something, not =
    if voc = 5 then
  
        -- Not using real/correct function. Try searching for doPlayerAddItem
        doplayer additem{item=3966, count=1}, -- Staff
        doplayer additem{item=2275, count=1}, -- Mana
      
        -- Not using real/correct function. Try searching for doPlayerAddSkill
        doplayer additem add level 700
      
        doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
        doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)...
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

    -- "get player" is not a real function. Try searching for getPlayerVocation
    voc = get player
  
    -- need to use == to compare something, not =
    if voc = 5 then
  
        -- Not using real/correct function. Try searching for doPlayerAddItem
        doplayer additem{item=3966, count=1}, -- Staff
        doplayer additem{item=2275, count=1}, -- Mana
      
        -- Not using real/correct function. Try searching for doPlayerAddSkill
        doplayer additem add level 700
      
        doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
        doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)
      
        -- this return true, should be moved just above the last end, so the main function returns
        -- but it's not 100% necessary to do so
        return true
      
    -- this else is not required
    else
    end
    -- this is where I'm talking about
end
 
Solution
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

    -- "get player" is not a real function. Try searching for getPlayerVocation
    voc = get player
 
    -- need to use == to compare something, not =
    if voc = 5 then
 
        -- Not using real/correct function. Try searching for doPlayerAddItem
        doplayer additem{item=3966, count=1}, -- Staff
        doplayer additem{item=2275, count=1}, -- Mana
     
        -- Not using real/correct function. Try searching for doPlayerAddSkill
        doplayer additem add level 700
     
        doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
        doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)
     
        -- this return true, should be moved just above the last end, so the main function returns
        -- but it's not 100% necessary to do so
        return true
     
    -- this else is not required
    else
    end
    -- this is where I'm talking about
end
i got this error
Gyazo - 1e7b5b58f86279be2d0fdbbb0acecb79.png
1e7b5b58f86279be2d0fdbbb0acecb79

and here is my script
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) == 5 then
        doPlayerAddItem(cid, 3966)
       doPlayerAddItem  doPlayerAddItem(cid, 2275)

        doPlayerAddSkill(cid, SKILL__level, 700)
        doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
        doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)
  
    end
end
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) == 5 then
   
        -- both of these are improper functions
        -- doPlayerAddItem(uid, itemid, count)
        doPlayerAddItem(cid, 3966)
        doPlayerAddItem  doPlayerAddItem(cid, 2275)
   
        doPlayerAddSkill(cid, SKILL__level, 700)
        doPlayerSendTextMessage(cid,19,"Realy you Have A Items Check Your Backpack.")
        doSendAnimatedText(getThingPos(cid), "Yeah Exp With I tems!!", TEXTCOLOR_RED)
   
    end
    -- you forgot return true
end
 
Back
Top