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

Lua <eof> ?

Triggah

TrigCore
Joined
Aug 1, 2007
Messages
436
Reaction score
2
[21/07/2009 13:41:12] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/rings.lua)
[21/07/2009 13:41:12] data/actions/scripts/quests/rings.lua:13: '<eof>' expected near 'end'

what does <eof> mean?
 
i know this looks awfully wrong, but can u explain what i did wrong here?

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 9003) == -1 then
                setPlayerStorageValue(cid, 9003, 1)
                local bp1 = doPlayerAddItem(cid, 1991, 1)
			
			
			doAddContainerItem(bp1, bp2, 1)
			doAddContainerItem(bp1, bp3, 1)
			doAddContainerItem(bp1, bp4, 1)	
                
		for i = 1,20 do
            doAddContainerItem(bp2, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp3, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp4, 2268, 3)
        end				
                doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
        else
                doPlayerSendCancel(cid, 'This chest is empty.')
        end     
    return TRUE
end

btw i suck at tabbing, but im learning lol
 
Because u didnt declared "bp2, bp3..."

Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 9003) == -1 then
                setPlayerStorageValue(cid, 9003, 1)
                local bp1 = doPlayerAddItem(cid, 1991, 1)
                local bp2 = doPlayerAddItem(cid, 2000, 1)
                local bp3 = doPlayerAddItem(cid, 2000, 1)
                local bp4 = doPlayerAddItem(cid, 2000, 1)

                        doAddContainerItem(bp1, bp2, 1)
                        doAddContainerItem(bp1, bp3, 1)
                        doAddContainerItem(bp1, bp4, 1)
               
                for i = 1,20 do
            doAddContainerItem(bp2, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp3, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp4, 2268, 3)
        end                            
                doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
        else
                doPlayerSendCancel(cid, 'This chest is empty.')
        end    
    return TRUE
end

this stills wrong. let me try to fix it xd
 
You're using a loop to add each container :eek: it's pretty useless unless you want to add each container 19 times.

@Gattaca
The error is here. doPlayerSendtext message should be replaced with doPlayerSendTextMessage:
Lua:
	else -- If storage is used...
		doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.")                    
	end

And wtf is that script you posted with 3 loops in it? I would be ashamed to be called OTLand's developer if I posted such a script.
 
Back to the first question, <eof> stands for End Of File and is displayed if you have too many of 'end's actually.
 
i tried your script and the chest gave me an empty green bag

@nikolas

wat do u mean?

Lua:
                for i = 1,20 do
            doAddContainerItem(bp2, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp3, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp4, 2268, 3)
        end

By doing that thing it's like executing these doAddContainerItem functions 19 times each, so you totally get 57 containers.
 
I fix it

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 9003) == -1 then
                setPlayerStorageValue(cid, 9003, 1)
                local bp1 = doPlayerAddItem(cid, 1991, 1)
                local bp2 = doAddContainerItem(bp1, 2000, 1)
                local bp3 = doAddContainerItem(bp1, 2000, 1)
                local bp4 = doAddContainerItem(bp1, 2000, 1)
               
                for i = 1,20 do
            doAddContainerItem(bp2, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp3, 2268, 3)
        end

        for i = 1,20 do
            doAddContainerItem(bp4, 2268, 3)
        end                            
                doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
        else
                doPlayerSendCancel(cid, "This chest is empty.")
        end    
    return TRUE
end

Again "T" DOESNT MATTER IF IS "t" IS THE SAME CHARACTER DAMNT.

I fixed it, it gives 1 green bag, inside 3 red backpacks of sds x3 (each backpack has 20 sds of 3x) fixed and working dont say not.
 
Triggah its just am testing it on my own server
He is not, and he doesnt know the error it gives.

It says that the "Containers" bp2, bp3, bp4 doesnt exists, cuz u didnt declared them, so i declared them as an "local == bp3 AddContainerItem(bp1, 2000, 1)" and it worked.

As if you see;

Lua:
local bp1 = doPlayerAddItem(cid, 1991, 1) --Add first backpack as bp1
local bp2 = doAddContainerItem(bp1, 2000, 1) --Add a backpack to bp1

And we had to declare bp2 because we'r gonna use it for give it sds so;

Lua:
for i = 1,20 do
 doAddContainerItem(bp2, 2268, 3)
end

Gattaca~~ (C). Venezuela.
 
a little complication: how would u make it so that theres a bp with 19 sd runes (3 charges each) and another bp in that bp with sd runes?
 
Is easy to do so, has am only 15 years old. My brain is not at all for program so, i just play with it.

We can say

Lua:
local bp1 = doPlayerAddItem(cid, 1991, 1) --Bp1
local bp2 = doAddContainerItem(bp1, 2000, 1) --bp2 This will a backpack to bp1
local bp3 = doAddContainerItem(bp2, 2000, 1) --bp3 This will a backpack to bp2

for i = 1,19 do
  doAddContainerItem(bp1, 2268, 3) --This add 19 sds to bp1
end

for i = 1,19 do
  doAddContainerItem(bp2, 2268, 3) --This add 19 sds to bp2
end

for i = 1,20 do
  doAddContainerItem(bp3, 2268, 3) --This add 20 sds to bp3
end

And we it we got.

A backpack with 19 sds, inside a backpack with 19 sds, inside a backpack with 20 sds x3 each ^^
 
Well change the bag id for the backpack id.

Lua:
  local bp1 = doPlayerAddItem(cid, 2000, 1) --Bp1
local bp2 = doAddContainerItem(bp1, 2000, 1) --bp2 This will a backpack to bp1
local bp3 = doAddContainerItem(bp2, 2000, 1) --bp3 This will a backpack to bp2

for i = 1,19 do
  doAddContainerItem(bp1, 2268, 3) --This add 19 sds to bp1
end

for i = 1,19 do
  doAddContainerItem(bp2, 2268, 3) --This add 19 sds to bp2
end

for i = 1,20 do
  doAddContainerItem(bp3, 2268, 3) --This add 20 sds to bp3
end

Done.

With it you'll got;

Backpack -> 19sds + 1 bp -> 19 sds + 1 bp -> 20 sds

xD
In-depth if you want it to give more and more bps with sds on it, just multiply the part of the code;

Lua:
local bp4 = doAddContainerItem(bp3, 2000, 1) --bp4 This will a backpack to bp3

for i = 1,20 do
  doAddContainerItem(bp4, 2268, 3) --This add 20 sds to bp4
end

As you can see, by only knowing english you can'b an programmer.

Also if you speak br, spanish, i can help you. i speak English, Br, Spanish. If you dont understand english haha

--------------------
The post is complete solved. Please change it tittle for can mods delete it, and evite spam hehe just an idea.

You'r welcome. If you got any more questions, just post here on "Support" board.

Gattaca (C).
 
Last edited:
Back
Top