IMyth Posted July 13, 2019 Share Posted July 13, 2019 Burger system is not working ,Please Check it. (Setting.Lua Should be fix I Think) cBurgershot.Lua addEvent("open:burgershotUI",true) addEventHandler("open:burgershotUI",root,function() if(isLoggedin())then if(getElementData(lp,"ElementClicked")==false)then local BurgerCount=0 setWindowData("add","cursor_clicked",true) CoD.Window[1]=dgsCreateWindow(GLOBALscreenX/2-400/2,GLOBALscreenY/2-250/2,400,250,settings.general.servername.." - BurgershotUI",false,tocolor(255,255,255),nil,nil,settings.general.guimaincolor,nil,nil,nil,true) dgsWindowSetSizable(CoD.Window[1],false) dgsWindowSetMovable(CoD.Window[1],false) CoD.Button[1]=dgsCreateButton(374,-25,26,25,"×",false,CoD.Window[1],_,_,_,_,_,_,tocolor(200,50,50,255),tocolor(250,20,20,255),tocolor(150,50,50,255),true) CoD.Button[2]=dgsCreateButton(10,10,35,150,"<",false,CoD.Window[1],_,_,_,_,_,_,tocolor(50,50,50,255),tocolor(90,90,90,255),tocolor(10,10,10,255),true) CoD.Button[3]=dgsCreateButton(355,10,35,150,">",false,CoD.Window[1],_,_,_,_,_,_,tocolor(50,50,50,255),tocolor(90,90,90,255),tocolor(10,10,10,255),true) CoD.Button[4]=dgsCreateButton(60,10,35,150,"<<",false,CoD.Window[1],_,_,_,_,_,_,tocolor(50,50,50,255),tocolor(90,90,90,255),tocolor(10,10,10,255),true) CoD.Button[5]=dgsCreateButton(305,10,35,150,">>",false,CoD.Window[1],_,_,_,_,_,_,tocolor(50,50,50,255),tocolor(90,90,90,255),tocolor(10,10,10,255),true) dgsCreateImage(150,40,100,100,":"..settings.general.scriptname.."/IMAGES/Inventory/Burger.png",false,CoD.Window[1]) CoD.Label[1]=dgsCreateLabel(195,25,20,20,"0",false,CoD.Window[1],_,_,_,_,_,_,"center",_) CoD.Button[6]=dgsCreateButton(10,175,380,40,"Buy 0x $0",false,CoD.Window[1],_,_,_,_,_,_,tocolor(50,50,50,255),tocolor(90,90,90,255),tocolor(10,10,10,255),true) addEventHandler("onDgsMouseClick",CoD.Button[6], function(btn,state) if(btn=="left" and state=="up")then local amount=dgsGetText(CoD.Label[1]) triggerServerEvent("buy:shopitem",lp,"Burger",amount) end end, false) addEventHandler("onDgsMouseClick",CoD.Button[5], function(btn,state) if(btn=="left" and state=="up")then BurgerCount=BurgerCount+2 if(BurgerCount>=20)then BurgerCount=20 end dgsSetText(CoD.Label[1],BurgerCount) dgsSetText(CoD.Button[6],"Buy "..BurgerCount.."x $"..BurgerCount*settings.shop.price.burger) end end, false) addEventHandler("onDgsMouseClick",CoD.Button[4], function(btn,state) if(btn=="left" and state=="up")then BurgerCount=BurgerCount-2 if(BurgerCount<=0)then BurgerCount=0 end dgsSetText(CoD.Label[1],BurgerCount) dgsSetText(CoD.Button[6],"Buy "..BurgerCount.."x $"..BurgerCount*settings.shop.price.burger) end end, false) addEventHandler("onDgsMouseClick",CoD.Button[3], function(btn,state) if(btn=="left" and state=="up")then BurgerCount=BurgerCount+1 if(BurgerCount>=20)then BurgerCount=20 end dgsSetText(CoD.Label[1],BurgerCount) dgsSetText(CoD.Button[6],"Buy "..BurgerCount.."x $"..BurgerCount*settings.shop.price.burger) end end, false) addEventHandler("onDgsMouseClick",CoD.Button[2], function(btn,state) if(btn=="left" and state=="up")then BurgerCount=BurgerCount-1 if(BurgerCount<=0)then BurgerCount=0 end dgsSetText(CoD.Label[1],BurgerCount) dgsSetText(CoD.Button[6],"Buy "..BurgerCount.."x $"..BurgerCount*settings.shop.price.burger) end end, false) addEventHandler("onDgsMouseClick",CoD.Button[1], function(btn,state) if(btn=="left" and state=="up")then dgsCloseWindow(CoD.Window[1]) setWindowData("remove","cursor_clicked",true) end end, false) end end end) meta.xml <meta> <info author="IMyth" type="script" version="1.0.0" /> <script src="Setting.Lua" type="server" /> <script src="sBuyShopItems.Lua" type="server" /> <script src="sBurgershot.Lua" type="server" /> <script src="teleporter.Lua" type="server" /> <script src="cBurgershot.Lua" type="server" /> <script src="Setting.Lua" type="server" /> <cdn src="/IMAGES/Icon/In.png" /> <cdn src="/IMAGES/Icon/Out.png" /> <cdn src="/IMAGES/Shop/Shop.png" /> <cdn src="/IMAGES/Inventory/Burger.png" /> </meta> sBurgershot.Lua local function buyFoodBurgershot_Func(player) if(getElementInterior(player)==10 and getElementDimension(player)==50)then triggerClientEvent(player,"open:burgershotUI",player) elseif(getElementInterior(player)==10 and getElementDimension(player)==51)then triggerClientEvent(player,"open:burgershotUI",player) end end local buyFoodBurgershot=createCmarker(376.5,-67.4,1001.5,10,50,":"..settings.general.scriptname.."/IMAGES/Shop/Shop.png",nil,0.9,false,buyFoodBurgershot_Func) local buyFoodBurgershot=createCmarker(376.5,-67.4,1001.5,10,51,":"..settings.general.scriptname.."/IMAGES/Shop/Shop.png",nil,0.9,false,buyFoodBurgershot_Func) sBuyShopItems.Lua addEvent("buy:shopitem",true) addEventHandler("buy:shopitem",root,function(typ,amount) if(typ=="Burger")then if(amount:len()>=1)then if(getPlayerSelfMoney(client,"money")>=tonumber(amount*settings.shop.price.burger))then if(syncGetElementData(client,"Burger")+amount<=50)then syncSetElementData(client,"Burger",tonumber(syncGetElementData(client,"Burger"))+amount) takePlayerSelfMoney(client,"money",amount*settings.shop.price.burger) else notificationShow(client,"error","You can not own more than 50x Burgers") end else notificationShow(client,"error","You do have not enough money! ($"..amount*settings.shop.price.burger..")") end end end end) Setting.Lua (I think Setting.Lua is not working.) settings={ general={ Burger={ price={ burger=25, }, }, end teleporter.Lua local function goInIntBurgershotTemple_Func(player) if(getElementInterior(player)==0 and getElementDimension(player)==0)then fadeElementInterior(player,363.8,-74.5,1001.5,307,10,50,true) end end local function goOutIntBurgershotTemple_Func(player) if(getElementInterior(player)==10 and getElementDimension(player)==50)then fadeElementInterior(player,1199.3,-919.8,43.1,180,0,0,true) end end local function goInIntBurgershotRedsants_Func(player) if(getElementInterior(player)==0 and getElementDimension(player)==0)then fadeElementInterior(player,363.8,-74.5,1001.5,307,10,51,true) end end local function goOutIntBurgershotRedsants_Func(player) if(getElementInterior(player)==10 and getElementDimension(player)==51)then fadeElementInterior(player,1874.1,2071.8,11.1,270,0,0,true) end end local goInIntBurgershotTemple=createCmarker(1199.2,-918.4,43.1,0,0,":"..settings.general.scriptname.."/IMAGES/Icon/In.png","Ground",0.9,false,goInIntBurgershotTemple_Func) local goOutIntBurgershotTemple=createCmarker(363.0,-75.1,1001.5,10,50,":"..settings.general.scriptname.."/IMAGES/Icon/Out.png","Ground",0.9,false,goOutIntBurgershotTemple_Func) local goInIntBurgershotRedsants=createCmarker(1872.5,2071.9,11.1,0,0,":"..settings.general.scriptname.."/files/IMAGES/Icon/In.png","Ground",0.9,false,goInIntBurgershotRedsants_Func) local goOutIntBurgershotRedsants=createCmarker(363.0,-75.1,1001.5,10,51,":"..settings.general.scriptname.."/files/IMAGES/Icon/Out.png","Ground",0.9,false,goOutIntBurgershotRedsants_Func) Link to comment
HassoN Posted July 13, 2019 Share Posted July 13, 2019 Posting the whole resource and asking us to find the problem is not going to work out. Use /debugscript 3 then run the resource and give us the error message along with the concerned code. Link to comment
DNL291 Posted July 13, 2019 Share Posted July 13, 2019 Tell us what /debugscript 3 shows. Btw, Setting.Lua has an extra end. Also } missing which suggests that a snippet of code was removed. Link to comment
IMyth Posted July 14, 2019 Author Share Posted July 14, 2019 13 hours ago, DNL291 said: Tell us what /debugscript 3 shows. Btw, Setting.Lua has an extra end. Also } missing which suggests that a snippet of code was removed. ERROR: Couldn't find script Setting.Lua for resource Burger Loading of resource 'Burger' failed Link to comment
HassoN Posted July 14, 2019 Share Posted July 14, 2019 1 hour ago, IMyth said: ERROR: Couldn't find script Setting.Lua for resource Burger Loading of resource 'Burger' failed Obviously 'Setting.Lua' is missing. Either you remove it from the meta or add it to the folder of the resource to get your resource running. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now