Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: Go Hard on July 20, 2013, 11:54:48 AM

Title: CMD error
Post by: Go Hard on July 20, 2013, 11:54:48 AM
So like i've been told. I've looked into lua scripting and it's going good so far, but all of a sudden when i use the "Luac -o ArcRace1.lur ScriptName.lua " code in cmd to compile, i get an error message that reads: "luarscript.lua:14: unexpected symbol near "-".
Any help would be great thanks. It was working like 10 minutes ago, now it just comes up with that.

-Josh
Title: Re: CMD error
Post by: WhenLifeGivesYouLemons on July 20, 2013, 12:06:08 PM
Which means something is wrong around line 14 in your script. Look for any mistakes you made like missing " " or closing your codes with ( ). If you can find the problem directly post your script and we can try to fix it  :)
Title: Re: CMD error
Post by: c00ld0c26 on July 20, 2013, 12:21:47 PM
Like Lemon said.
If u dont find the problem then post the script.
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 12:24:34 PM
Thanks guys, everyone is pretty supportive on here. Glad i joined, i'll be back on there soon so i'll be sure to post it if i don't figure out what i did. :D
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 01:32:16 PM
Right okay guys, this is just the basic script i got off SWEGTA and i added a few things to it:


ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
 
  PlayerSetHealth(700) -- gives the player 700 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
  DisablePunishmentSystem = TRUE
 
 TextPrintString("BodyGuard Mod Test", 4, 1) -

  Bif = PedCreateXYZ(33, l_1_0 +1, l_1_1 +1, l_1_2+1)
  PedRecruitAlly(gplayer, Bif)
  PedSetWeapon(Bif, 324,1) -
  Darby = PedCreateXYZ(37, l_1_0 +2, l_1_1 +2, l_1_2+2)
  PedRecruitAlly(Bif, Darby)
end
 
MissionCleanup = function()
end -- end statement
 
main = function() -- Main mission function
  repeat
    Wait(0)
  until l_0_0 ~= false
  Wait(3000)
  MissionSucceed()
end


I removed the Text thing and now i get line 16 error with the bif weapon thing, can someone tell me how to spawn him with a sledgehammer?
Title: Re: CMD error
Post by: Red Blaster on July 20, 2013, 01:43:22 PM
Right okay guys, this is just the basic script i got off SWEGTA and i added a few things to it:


ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local Bif = nil
  local l_1_2 = 6.4000000953674 -- Z coords
 
  PlayerSetHealth(700) -- gives the player 700 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
  DisablePunishmentSystem(true)
 
 TextPrintString("BodyGuard Mod Test", 4, 1)

  Bif = PedCreateXYZ(33, l_1_0 +1, l_1_1 +1, l_1_2+1)
  PedRecruitAlly(gPlayer, Bif)
  PedSetWeapon(Bif, 324,1)
  Darby = PedCreateXYZ(37, l_1_0 +2, l_1_1 +2, l_1_2+2)
  PedRecruitAlly(Bif, Darby)
end
 
MissionCleanup = function()
end -- end statement
 
main = function() -- Main mission function
  repeat
    Wait(0)
  until l_0_0 ~= false
  Wait(3000)
  MissionSucceed()
end


I removed the Text thing and now i get line 16 error with the bif weapon thing, can someone tell me how to spawn him with a sledgehammer?


^ Fixed.
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 01:53:35 PM
Thanks a lot man! works great.
Title: Re: CMD error
Post by: c00ld0c26 on July 20, 2013, 01:55:27 PM
Shit, was AFK
lol I was gonna fix there.
Oh well, Red did the work, good job Red.
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 05:00:01 PM
Could anyone possibly tell me where i went wrong and why you changed the things you did? Sorry am a proper noob to this haha.
Title: Re: CMD error
Post by: WhenLifeGivesYouLemons on July 20, 2013, 05:38:36 PM
Could anyone possibly tell me where i went wrong and why you changed the things you did? Sorry am a proper noob to this haha.
I am probably guessing line 14 was around this code..
DisablePunishmentSystem = TRUE

Red fixed the code to look like this
DisablePunishmentSystem(true)
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 05:41:05 PM
Oh okay, thanks. What about at the top? "local bif = nill"? Cheers again.
Title: Re: CMD error
Post by: WhenLifeGivesYouLemons on July 20, 2013, 05:45:35 PM
Oh okay, thanks. What about at the top? "local bif = nill"? Cheers again.
nil with one L lol thats so the name Bif can be local in LUA
Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 05:48:41 PM
Lmao, thanks man.
Title: Re: CMD error
Post by: Red Blaster on July 20, 2013, 06:51:03 PM
Where did you go wrong? I will write the parts in red (no pun intended).

Right okay guys, this is just the basic script i got off SWEGTA and i added a few things to it:


ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
 
  PlayerSetHealth(700) -- gives the player 700 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
  DisablePunishmentSystem = TRUE This should be DisablePunishmentSystem(true)
 
 TextPrintString("BodyGuard Mod Test", 4, 1) - Why is there a dash here? That's what caused the unexpected symbol message

  Bif = PedCreateXYZ(33, l_1_0 +1, l_1_1 +1, l_1_2+1) To be safe, always define a local meant for a character spawn as nil in the beginning of the script, as I did
  PedRecruitAlly(gplayer, Bif)
  PedSetWeapon(Bif, 324,1) - Again, why the dash?
  Darby = PedCreateXYZ(37, l_1_0 +2, l_1_1 +2, l_1_2+2)
  PedRecruitAlly(Bif, Darby)
end
 
MissionCleanup = function()
end -- end statement
 
main = function() -- Main mission function
  repeat
    Wait(0)
  until l_0_0 ~= false
  Wait(3000)
  MissionSucceed()
end

Title: Re: CMD error
Post by: Go Hard on July 20, 2013, 06:58:36 PM
Hahaha, random dashes FTW! Nahh:P thanks dude, helps a lot.