andrius Posted November 5, 2019 Share Posted November 5, 2019 (edited) main.Lua file: function gamemodeResourceLoaded ( res ) addPickupItem(1, 1, 0, 0, 0) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), gamemodeResourceLoaded ) ground_items/items_func.Lua file: function addPickupItem(item, ammount, x, y, z) return true end meta.xml: <meta> <info author="Andrius" description="None" version="1.0" type="gamemode" /> <script src="main.Lua" type="server" /> <!-- Items --> <file src="ground_items/items_func.Lua" type="server" /> </meta> Error on resource start: [2019-11-05 17:24:45] ERROR: [gamemodes]\simplemode\main.Lua:27: attempt to call global 'addPickupItem' (a nil value) 27 line is: addPickupItem(1, 1, 0, 0, 0) Can someone explain this magic to me? function declared, but also it is not or what --------------------------------------------------- SOLVED. It should be <script src="ground_items/items_func.Lua" type="server" /> NOT <file src="ground_items/items_func.Lua" type="server" /> :D Edited November 5, 2019 by andrius Solved problem Link to comment
Lachuks Posted November 5, 2019 Share Posted November 5, 2019 (edited) <file src="ground_items/items_func.Lua" type="server" /> <!-- Why <file>? --> <!-- should be like that --> <script src="ground_items/items_func.Lua" type="server" /> Maybe this? :3 Edited November 5, 2019 by Emix Link to comment
andrius Posted November 5, 2019 Author Share Posted November 5, 2019 (edited) Yeah, I figured it out (as seen in edit), but thanks anyway Edited November 5, 2019 by andrius 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