News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: I can not compile anything luascript.lua:5: unexpected symbol near 'T'  (Read 8590 times)

0 Members and 1 Guest are viewing this topic.

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

 l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act"
  end
  UpdateTextQueue()
    Wait(0)
  end
end

deadpoolXYZ

  • Guest
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #1 on: February 19, 2015, 12:38:11 PM »
Dude that's my avatar -.-

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #2 on: February 19, 2015, 12:44:41 PM »
Dude that's my avatar -.-
sorry, but help me please

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #3 on: February 19, 2015, 12:49:56 PM »
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

 l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act")
  end
  UpdateTextQueue()
    Wait(0)
  end
end


I fixed it.


You forgot a "   )  "

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #4 on: February 19, 2015, 12:54:42 PM »
The same error is happening, no code works :(

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #5 on: February 19, 2015, 01:02:25 PM »
I've tried various codes, but always of the same error

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,423
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #6 on: February 19, 2015, 01:11:16 PM »
Code: [Select]
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

local l_0_0 = 60
local gMissionRunning = true

MissionSetup = function()
  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")

  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end


MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  if gMissionRunning == true then
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act")
  end
  UpdateTextQueue()
    Wait(0)
  end
end


You forgot to declare 1_0_0 a local. I think it should work now... hehe...
You also have multiple mission setup, so I did some minor adjustments to your script.

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #7 on: February 19, 2015, 01:18:52 PM »
Does not work I'm still desperate

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #8 on: February 19, 2015, 01:28:55 PM »
This error appears in all codes, even in codes that I was compiling perfect before

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #9 on: February 19, 2015, 01:43:47 PM »
I took out unnecessary code, and also fixed a few things. I compiled it successfully and could load the script successfully, I had 2 allies recruited and music was playing.
I added a comment to everything I changed.

Code: [Select]
-- Removed unnecessary imported scripts, you do not need them.

-- Removed l_0_0 = 60 because you never use it in the script

MissionSetup = function()
  -- Changed names of variables to something that makes more sense. X makes more sense than l_1_0
  local X = 270
  local Y = -110
  local Z = 6.4
  AreaTransitionXYZ(0, X, Y, Z)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, X +1, Y +1, Z +1)
  PedRecruitAlly(gPlayer, Johnny) -- Capitalized gPlayer. You had "gplayer"
  Hal = PedCreateXYZ(22, X +2, Y +2, Z +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("Act/Anim/G_Striker_A.act") -- Specified full directory of act file. You only had "G_Striker_A"
  LoadActionTree("Act/Anim/G_Johnny.act") -- Specified full directory of act file. You only had "G_Johnny"
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  -- Removed LaunchScript("SObjTest.lua") because there is no reason you need to launch another script for this mod

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
    if IsButtonPressed(2,0) then
      PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
    elseif IsButtonPressed(0,0) then
      PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
    elseif IsButtonPressed(15,0) then
      PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
    elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
      PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act") -- Added a ')' on the end. You forgot it.
    end
    UpdateTextQueue()
    Wait(0)
  end
end

I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and MadmaN's IMG Toolkit V1 to add/replace in the Scripts.img.
« Last Edit: February 19, 2015, 01:45:58 PM by DaBOSS54320 »

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #10 on: February 19, 2015, 01:46:19 PM »
still the same error

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #11 on: February 19, 2015, 01:47:01 PM »
I've tried with various codes and always the same error, what should it be?

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #12 on: February 19, 2015, 01:47:57 PM »
Something is wrong with your lua editor or compiler or visual studio then.

It worked for me perfectly, and I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and installed the Visual Studio version supplied with MadmaN's LuaC release.

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #13 on: February 19, 2015, 01:52:55 PM »
Something is wrong with your lua editor or compiler or visual studio then.

It worked for me perfectly, and I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and installed the Visual Studio version supplied with MadmaN's LuaC release.
what I can do ? could send me the link of all I need, I try to uninstall and reinstall
« Last Edit: February 19, 2015, 01:55:13 PM by Ky »

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
« Reply #14 on: February 19, 2015, 01:57:34 PM »
Notepad++: You'll use this to write your LUA code.

LuaC: You'll use this to compile the LUA code. Read all the ReadMe.txts and install what it says.

IMG Toolkit V1: You can use this to put your compiled LUR files into the Scripts.img. Make sure to delete the old LUR file of the one you're replacing first.