headscript Posted May 2, 2015 Author Share Posted May 2, 2015 Thanks Headscript! PS: Not to offend but it'll be nice if you can make your code readable. Edit: I can help you with that if you want help if you're going to make it readable. I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value" Even without the code it still has that error. This only happened since I've updated the Lua SDK. Please help. Thanks. With Code: function bodyguardScript.unload() for k, guard in pairs(guards) do if (guard ~= nil) then PED.DELETE_PED(guard) guards[k] = nil bodyguardCount = 0 end endend Without code still causes that error: function bodyguardScript.unload()end and you Sir just found a bug (no actually i forogt to update the main.lua in the zip sorry) headscript does this work with the new ScripthookV? yes apart from the bug mentioned above which i will fix instantly -Fixed just redownload it - i have nothing against help would be nice if you would make it readable Link to comment Share on other sites More sharing options...
Foul_Play Posted May 2, 2015 Share Posted May 2, 2015 Sure! What files need making readable? Thanks Headscript! PS: Not to offend but it'll be nice if you can make your code readable. Edit: I can help you with that if you want help if you're going to make it readable. I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value" Even without the code it still has that error. This only happened since I've updated the Lua SDK. Please help. Thanks. With Code: function bodyguardScript.unload() for k, guard in pairs(guards) do if (guard ~= nil) then PED.DELETE_PED(guard) guards[k] = nil bodyguardCount = 0 end endend Without code still causes that error: function bodyguardScript.unload()end and you Sir just found a bug (no actually i forogt to update the main.lua in the zip sorry) headscript does this work with the new ScripthookV? yes apart from the bug mentioned above which i will fix instantly -Fixed just redownload it - i have nothing against help would be nice if you would make it readable Link to comment Share on other sites More sharing options...
headscript Posted May 2, 2015 Author Share Posted May 2, 2015 Sure! What files need making readable? Thanks Headscript! PS: Not to offend but it'll be nice if you can make your code readable. Edit: I can help you with that if you want help if you're going to make it readable. I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value" Even without the code it still has that error. This only happened since I've updated the Lua SDK. Please help. Thanks. With Code: function bodyguardScript.unload() for k, guard in pairs(guards) do if (guard ~= nil) then PED.DELETE_PED(guard) guards[k] = nil bodyguardCount = 0 end endend Without code still causes that error: function bodyguardScript.unload()end and you Sir just found a bug (no actually i forogt to update the main.lua in the zip sorry) headscript does this work with the new ScripthookV? yes apart from the bug mentioned above which i will fix instantly -Fixed just redownload it - i have nothing against help would be nice if you would make it readable gui.lua main.lua for now Link to comment Share on other sites More sharing options...
Foul_Play Posted May 2, 2015 Share Posted May 2, 2015 Sure, I'll get working on it tomorrow when I'm back to my house. Sure! What files need making readable? Thanks Headscript! PS: Not to offend but it'll be nice if you can make your code readable. Edit: I can help you with that if you want help if you're going to make it readable. I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value" Even without the code it still has that error. This only happened since I've updated the Lua SDK. Please help. Thanks. With Code: function bodyguardScript.unload() for k, guard in pairs(guards) do if (guard ~= nil) then PED.DELETE_PED(guard) guards[k] = nil bodyguardCount = 0 end endend Without code still causes that error: function bodyguardScript.unload()end and you Sir just found a bug (no actually i forogt to update the main.lua in the zip sorry) headscript does this work with the new ScripthookV? yes apart from the bug mentioned above which i will fix instantly -Fixed just redownload it - i have nothing against help would be nice if you would make it readable gui.lua main.lua for now Link to comment Share on other sites More sharing options...
Royalgamer06 Posted May 2, 2015 Share Posted May 2, 2015 I got an error at this line: for mod in io.popen([[dir "scripts/libs/" /b ]]):lines() do in main.lua Do you know why? Link to comment Share on other sites More sharing options...
diamond-optic Posted May 3, 2015 Share Posted May 3, 2015 (edited) anyone able to get STAT_GET_INT to work for getting player cash? Im able to set player cash with STAT_SET_INT, but cant get the current cash value... quite likely Im doing this wrong, as its been quite a long time since I did anything like this and the last language I worked with heavily was pawn.. local character = 1 -- 0: michael -- 1: franklin -- 2: trevor print("-----------------------") print("char: ", character) local hashname = string.format("SP%d_TOTAL_CASH", character) print("name: ", hashname) local hash = GAMEPLAY.GET_HASH_KEY(hashname) print("hash: ", hash) local oldcash = 0 STATS.STAT_GET_INT(hash, oldcash, -1) local newcash = oldcash + 100 STATS.STAT_SET_INT(hash, newcash, true) print("old: ", oldcash) print("new: ", newcash) print("-----------------------") it always just sets the cash to the 100 Edited May 3, 2015 by diamond-optic Link to comment Share on other sites More sharing options...
mitterdoo Posted May 3, 2015 Share Posted May 3, 2015 (edited) does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? Edited May 3, 2015 by mitterdoo M60warrior 1 Link to comment Share on other sites More sharing options...
xsploit Posted May 3, 2015 Share Posted May 3, 2015 local Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do print("Give Weapon to "..v) WEAPON.GIVE_DELAYED_WEAPON_TO_PED(v, GAMEPLAY.GET_HASH_KEY("WEAPON_RAILGUN"), 1000, false)end Does this work for everybody? Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 (edited) does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })()) Edited May 3, 2015 by headscript Link to comment Share on other sites More sharing options...
xsploit Posted May 3, 2015 Share Posted May 3, 2015 (edited) does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra it crashes for me no matter what all i want to do was player._set_player_model they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run Edited May 3, 2015 by xsploit Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra it crashes for me no matter what all i want to do was player._set_player_model they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash) show me what u did if that doesnt work Link to comment Share on other sites More sharing options...
xsploit Posted May 3, 2015 Share Posted May 3, 2015 (edited) does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra it crashes for me no matter what all i want to do was player._set_player_model they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash) show me what u did if that doesnt work ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do print("Give Weapon to "..v) PLAYER.SET_PLAYER_MODELend I guess player only refers to the local player Edited May 3, 2015 by xsploit Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra it crashes for me no matter what all i want to do was player._set_player_model they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash) show me what u did if that doesnt work ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do print("Give Weapon to "..v) PLAYER.SET_PLAYER_MODELend I guess player only refers to the local player player refers to all players in the lobby others are Ped's Link to comment Share on other sites More sharing options...
xsploit Posted May 3, 2015 Share Posted May 3, 2015 does anybody know why some lua functions aren't here? for example getfenv or loadstring does not work. need loadstring for a lua prompt so i can mess around and also possibly reload a script edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot? it should not show me your code for example getfenv or loadstring does not work. which are both no Lua 5.2 functions? quote from Wiki Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues. print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra it crashes for me no matter what all i want to do was player._set_player_model they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash) show me what u did if that doesnt work ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do print("Give Weapon to "..v) PLAYER.SET_PLAYER_MODELend I guess player only refers to the local player player refers to all players in the lobby others are Ped's thanks maybe i'll try CHANGE_PLAYER_PED if i cant get the params right if not figure out how to get the zombie model to attack ppl with guns Link to comment Share on other sites More sharing options...
ILS_Supernova Posted May 3, 2015 Share Posted May 3, 2015 Can someone help please, Ive installed everything in right place and all required items but get failed to load in asi.loader! Link to comment Share on other sites More sharing options...
lilw Posted May 3, 2015 Share Posted May 3, 2015 There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this. Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this. local playerPed = PLAYER.PLAYER_PED_ID() local pedPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0) local hash = GAMEPLAY.GET_HASH_KEY(vehicle) STREAMING.REQUEST_MODEL(hash) local executionBreaker = 0 while( not STREAMING.HAS_MODEL_LOADED(hash) and executionBreaker< 50)do wait(0) executionBreaker= executionBreaker +1 end local veh = VEHICLE.CREATE_VEHICLE(hash, pedPosition.x,pedPosition.y,pedPosition.z, 0, false, false) PED.SET_PED_INTO_VEHICLE(playerPed,veh,-1) lilw 1 Link to comment Share on other sites More sharing options...
Foul_Play Posted May 3, 2015 Share Posted May 3, 2015 Mr HeadScript, I've done the main.lua file for you. Also I've changed "addins" to addons and bug tested it. The reason I've changed it because "addins" doesn't sound good. To load custom scripts, they now go in the "addons" folder. I've changed the prints to make it easier for you and other modders to read. The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line. Is there anyway to send you the file? PS: I'm going to start working on gui.lua when I can. Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 (edited) Mr HeadScript, I've done the main.lua file for you. Also I've changed "addins" to addons and bug tested it. The reason I've changed it because "addins" doesn't sound good. To load custom scripts, they now go in the "addons" folder. I've changed the prints to make it easier for you and other modders to read. The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line. Is there anyway to send you the file? PS: I'm going to start working on gui.lua when I can. stay with addins i have reserved addons for a different functionality already^^ and thank you very much just add me on skype or something (fabs1996) Edited May 3, 2015 by headscript Link to comment Share on other sites More sharing options...
Foul_Play Posted May 3, 2015 Share Posted May 3, 2015 Okay, can you PM me where you're from because I found someone with that Skype name and isn't from Germany. Also I'll change "addons" to "addins" now. Mr HeadScript, I've done the main.lua file for you. Also I've changed "addins" to addons and bug tested it. The reason I've changed it because "addins" doesn't sound good. To load custom scripts, they now go in the "addons" folder. I've changed the prints to make it easier for you and other modders to read. The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line. Is there anyway to send you the file? PS: I'm going to start working on gui.lua when I can. stay with addins i have reserved addons for a different functionality already^^ and thank you very much just add me on skype or something (fabs1966) Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 The member Foul_Play can not use the messaging system and my name is fabs1996 sorry Link to comment Share on other sites More sharing options...
ILS_Supernova Posted May 3, 2015 Share Posted May 3, 2015 Can someone please try help me? Trying to install this as I wanna try some scripts out but the asi,loader says this, ASI: Loading "C:\Program Files\Rockstar Games\Grand Theft Auto V\LUA.asi" "LUA.asi" failed to load Link to comment Share on other sites More sharing options...
headscript Posted May 3, 2015 Author Share Posted May 3, 2015 you installed https://www.microsoft.com/en-us/download/details.aspx?id=40784 ? Link to comment Share on other sites More sharing options...
ILS_Supernova Posted May 3, 2015 Share Posted May 3, 2015 you installed https://www.microsoft.com/en-us/download/details.aspx?id=40784 ? Yeah downloaded that and I just came up with repair or unistall ? So I repaired . . . Link to comment Share on other sites More sharing options...
Foul_Play Posted May 3, 2015 Share Posted May 3, 2015 Did it fix it? Link to comment Share on other sites More sharing options...
ffzero58 Posted May 3, 2015 Share Posted May 3, 2015 Thanks now i have to make a delete script Have you made a working delete script? Using DELETE_OBJECT does not remove it straight away. Also, it seems some of the objects only spawn when they are in the right area of the map. Have you seen something similar? Link to comment Share on other sites More sharing options...
sakis25 Posted May 3, 2015 Share Posted May 3, 2015 Is it possible to check what weapon is the player currently holding and then lose ammo of that weapon by a key press? I'm trying GET_CURRENT_PED_WEAPON but I'm getting a "nil" error. Link to comment Share on other sites More sharing options...
xsploit Posted May 4, 2015 Share Posted May 4, 2015 local Zombie = {}Zombie.peds = {}Zombie.howMany = 0function Zombie.unload()end function Zombie.tick() if(get_key_pressed(117)) then local playerPed = PLAYER.PLAYER_PED_ID() local player = PLAYER.GET_PLAYER_PED(playerPed) local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)local Table,Count = PED.GET_PED_NEARBY_PEDS(PLAYER.PLAYER_PED_ID(), 55.0, 1) for k,v in ipairs(Table) do PED.SET_PED_AS_ENEMY(v, true) PED.SET_CAN_ATTACK_FRIENDLY(playerPed,true,true) PED.SET_PED_COMBAT_ABILITY(v, 2) PED.SET_PED_COMBAT_RANGE(v, 500) end end end return Zombie tick: scripts/addins/riftmodule.lua:10: error in function 'GET_PED_NEARBY_PEDS'. argument #1 is 'nil'; 'number' expected. it either crashes or doesnt work Link to comment Share on other sites More sharing options...
azam8 Posted May 4, 2015 Share Posted May 4, 2015 you installed https://www.microsoft.com/en-us/download/details.aspx?id=40784 ? Yeah downloaded that and I just came up with repair or unistall ? So I repaired . . . Make sure you don't have any other files in the addins folder. Like .rar .exe .7zip .asi etc it wont load the scipts otherwise. Link to comment Share on other sites More sharing options...
lilw Posted May 4, 2015 Share Posted May 4, 2015 There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this. local playerPed = PLAYER.PLAYER_PED_ID() local pedPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0) local hash = GAMEPLAY.GET_HASH_KEY(vehicle) STREAMING.REQUEST_MODEL(hash) local executionBreaker = 0 while( not STREAMING.HAS_MODEL_LOADED(hash) and executionBreaker< 50)do wait(0) executionBreaker= executionBreaker +1 end local veh = VEHICLE.CREATE_VEHICLE(hash, pedPosition.x,pedPosition.y,pedPosition.z, 0, false, false) PED.SET_PED_INTO_VEHICLE(playerPed,veh,-1) Thanks, but where should I put it in? I create new file with name veh.lua, try add "function" and other thing, but don't know how to make it loads. it always said "a nil value". Sorry, I'm freaking noob Link to comment Share on other sites More sharing options...