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
-
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
-
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 :)
-
Like Lemon said.
If u dont find the problem then post the script.
-
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
-
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?
-
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.
-
Thanks a lot man! works great.
-
Shit, was AFK
lol I was gonna fix there.
Oh well, Red did the work, good job Red.
-
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.
-
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)
-
Oh okay, thanks. What about at the top? "local bif = nill"? Cheers again.
-
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
-
Lmao, thanks man.
-
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
-
Hahaha, random dashes FTW! Nahh:P thanks dude, helps a lot.