Zalmon Posted October 16, 2011 Posted October 16, 2011 Okay, I want all of these peds to be headless and onfire.. I get an error "bad arguemnet @line 13" line 13 is the line that checks if they're headless or not. myZombies = { } zomb1 = createPed ( 0, 3340.4311523438, -1166.7451171875, 1077.25390625 ) zomb2 = createPed ( 0, 3341.4311523438, -1166.7451171875, 1077.25390625 ) zomb3 = createPed ( 0, 3342.4311523438, -1166.7451171875, 1077.25390625 ) zomb4 = createPed ( 0, 3343.4311523438, -1166.7451171875, 1077.25390625 ) zomb5 = createPed ( 0, 3340.4311523438, -1167.7451171875, 1077.25390625 ) zomb6 = createPed ( 0, 3298.4875488281, -1209.2786865234, 1077.25390625 ) zomb7 = createPed ( 0, 3298.4875488281, -1208.2786865234, 1077.25390625 ) zomb8 = createPed ( 0, 3298.4875488281, -1207.2786865234, 1077.25390625 ) zomb9 = createPed ( 0, 3298.4875488281, -1206.2786865234, 1077.25390625 ) zomb10 = createPed ( 0, 3298.4875488281, -1205.2786865234, 1077.25390625 ) function onStart() for k, ped in pairs( myZombies ) do head = isPedHeadless(ped) if head ~= true then setPedOnFire(ped, true) setPedHeadless(ped, true) end end end end addEventHandler("onResourceStart", resourceRoot, onStart)
CapY Posted October 16, 2011 Posted October 16, 2011 Maybe if head == true then No ? EDIT:I think that's not gonna work.
Zalmon Posted October 16, 2011 Author Posted October 16, 2011 Maybe if head == true then No ? EDIT:I think that's not gonna work. if head ~= true then means if head is false then if I do head == true then that would mean if the ped is headless then make him headless lol
TAPL Posted October 16, 2011 Posted October 16, 2011 myZombies = { zomb1 = createPed ( 0, 3340.4311523438, -1166.7451171875, 1077.25390625 ), zomb2 = createPed ( 0, 3341.4311523438, -1166.7451171875, 1077.25390625 ), zomb3 = createPed ( 0, 3342.4311523438, -1166.7451171875, 1077.25390625 ), zomb4 = createPed ( 0, 3343.4311523438, -1166.7451171875, 1077.25390625 ), zomb5 = createPed ( 0, 3340.4311523438, -1167.7451171875, 1077.25390625 ), zomb6 = createPed ( 0, 3298.4875488281, -1209.2786865234, 1077.25390625 ), zomb7 = createPed ( 0, 3298.4875488281, -1208.2786865234, 1077.25390625 ), zomb8 = createPed ( 0, 3298.4875488281, -1207.2786865234, 1077.25390625 ), zomb9 = createPed ( 0, 3298.4875488281, -1206.2786865234, 1077.25390625 ), zomb10 = createPed ( 0, 3298.4875488281, -1205.2786865234, 1077.25390625 ) } function onStart() for k, ped in pairs( myZombies ) do head = isPedHeadless(ped) if head ~= true then setPedOnFire(ped, true) setPedHeadless(ped, true) end end end addEventHandler("onResourceStart", resourceRoot, onStart)
Slothman Posted October 22, 2011 Posted October 22, 2011 your original script didn't add the zombies to the table, so your script was checking an empty table. btw, i dunno if it matters, but it might be a good idea to use a different table name if your adding that to the zombie resource (myzombies is the name of the table that is used to list the zombies that are chasing a player)
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