You need to repeat the TL button function in the Main function as shown here :
main = function
repeat
FUNCTION HERE
Wait(0)
until not Alive
MissionSetup = function()
local l_1_0 = 270
local l_1_1 = -110
local l_1_2 = 6.4000000953674
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
PedSetTypeToTypeAttitude(0, 13, 2)
PedSetTypeToTypeAttitude(1, 13, 2)
PedSetTypeToTypeAttitude(2, 13, 2)
PedSetTypeToTypeAttitude(3, 13, 2)
PedSetTypeToTypeAttitude(4, 13, 2)
PedSetTypeToTypeAttitude(5, 13, 2)
PedSetTypeToTypeAttitude(6, 13, 2)
PedSetTypeToTypeAttitude(7, 13, 2)
PedSetTypeToTypeAttitude(8, 13, 2)
PedSetTypeToTypeAttitude(9, 13, 2)
PedSetTypeToTypeAttitude(10, 13, 2)
PedSetTypeToTypeAttitude(11, 13, 2)
end
TL_Buttons = function()
if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
px,py,pz = PlayerGetPosXYZ()
TextPrintString("Player Pos: "..px..", "..py..", "..pz.."Area:"..AreaGetVisible(), 4, 2)
Wait(1000)
elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
Wait(1000)
end
end
main = function()
Load("Act/Dialog.act")
Load("Act/Debug.act")
F_TableInit()
CreateThread("TL_Buttons")
gMissionRunning = true
while gMissionRunning do
UpdateTextQueue()
TL_Buttons()
Wait(0)
end
end
main = function
repeat
if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
px,py,pz = PlayerGetPosXYZ()
TextPrintString("Player Pos: "..px..", "..py..", "..pz.."Area:"..AreaGetVisible(), 4, 2)
Wait(1000)
elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
Wait(1000)
Wait(0)
until not Alive
MissionCleanup = function()
EnablePOI()
gMissionRunning = false
end
This right? When I tried compiling it I got this in CMD:
luac: fs.lua:39: '<' expected near 'repeat'
I suck at this.