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

Error in quest script. help fast please

FakkaHe

New Member
Joined
Feb 2, 2008
Messages
110
Reaction score
0
Hello, i just made a new quest script to tfs 0.3.4, but it dosent work. this is the script


Code:
function onUse(cid, item, frompos, item2, topos)
  	
  	if item.uid == 11554 then
  		queststatus = getPlayerStorageValue(cid,11554)
  		if queststatus == -1 then
  			if getPlayerLevel(cid) >= 50 then
  				doPlayerSendTextMessage(cid,22,"You have found full citicent addon =).")
  				doPlayerAddItem(cid,2162,5)
  				doPlayerAddItem(cid,5890,100)
                                 doPlayerAddItem(cid,5902,50)
                                  doPlayerAddItem(cid,2480,1)
                                  doPlayerAddItem(cid,5878,100)
                                 setPlayerStorageValue(cid,11554,1)
  			else
  				doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
  			end
  		else
  			doPlayerSendTextMessage(cid,22,"You already took this quest, now... BEGONE!.")
  		end
  	end






and i addded
Code:
<action uniqueid="11554" script="quests/addonquest1.lua"/>
at actions.


but when i start the server it says

Code:
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/addonquest1.lua)
data/actions/scripts/quests/addonquest1.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'



please help me.
 
Lua:
function onUse(cid, item, frompos, item2, topos)
  	
  	if item.uid == 11554 then
  		queststatus = getPlayerStorageValue(cid,11554)
  		if queststatus == -1 then
  			if getPlayerLevel(cid) >= 50 then
  				doPlayerSendTextMessage(cid,22,"You have found full citicent addon =).")
  				doPlayerAddItem(cid,2162,5)
  				doPlayerAddItem(cid,5890,100)
                                 doPlayerAddItem(cid,5902,50)
                                  doPlayerAddItem(cid,2480,1)
                                  doPlayerAddItem(cid,5878,100)
                                 setPlayerStorageValue(cid,11554,1)
  			else
  				doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
  			end
  		else
  			doPlayerSendTextMessage(cid,22,"You already took this quest, now... BEGONE!.")
  		end
  	end
  	return TRUE
end

I hope it work for you ;).
 
Nope still same error code,
Code:
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/addonquest1.lua)
data/actions/scripts/quests/addonquest1.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'

Thanks for trying tho :(
 
Nope still same error code,
Code:
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/addonquest1.lua)
data/actions/scripts/quests/addonquest1.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'

Thanks for trying tho :(

Scroll down and try to copy the whole script <_<.
 
Code:
  function onUse(cid, item, frompos, item2, topos)
       
        if item.uid == 11554 then
                queststatus = getPlayerStorageValue(cid,11554)
                if queststatus == -1 then
                        if getPlayerLevel(cid) >= 50 then
                                doPlayerSendTextMessage(cid,22,"You have found full citicent addon =).")
                                doPlayerAddItem(cid,2162,5)
                                doPlayerAddItem(cid,5890,100)
                                 doPlayerAddItem(cid,5902,50)
                                  doPlayerAddItem(cid,2480,1)
                                  doPlayerAddItem(cid,5878,100)
                                 setPlayerStorageValue(cid,11554,1)
                        else
                                doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
                        end
                else
                        doPlayerSendTextMessage(cid,22,"You already took this quest, now... BEGONE!.")
                end
        end
        return TRUE
end



Code:
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/addonquest1.lua)
data/actions/scripts/quests/addonquest1.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>

Same error code. :S
 
Last edited:
Lua:
function onUse(cid, item, frompos, item2, topos)
	queststatus = getPlayerStorageValue(cid,11554)
	if queststatus == -1 then
		if getPlayerLevel(cid) >= 50 then
			doPlayerSendTextMessage(cid,22,"You have found full citicent addon =).")
			doPlayerAddItem(cid,2162,5)
			doPlayerAddItem(cid,5890,100)
			doPlayerAddItem(cid,5902,50)
			doPlayerAddItem(cid,2480,1)
			doPlayerAddItem(cid,5878,100)
			setPlayerStorageValue(cid,11554,1)
		else
			doPlayerSendTextMessage(cid,22,"You need level 50 to get prize.")
		end
	else
		doPlayerSendTextMessage(cid,22,"You already took this quest, now... BEGONE!.")
	end
	return TRUE
end
 
Back
Top