Jump to content
  • 0

error script not responding variable


XkPP

Question

function SPD()
if _bsd_8 == "ue0" then gg.alert("1") end
if _bsd_8 == "ue1" then gg.alert("2") end
if _bsd_8 == "ue2" then gg.alert("3") end
end

local DO = gg.alert("Select:","a","b","c")
if DO == 1 then _bsd_8 = "ue0", SPD() end
if DO == 2 then _bsd_8 = "ue1", SPD() end
if DO == 3 then _bsd_8 = "ue2", SPD() end

so it doesn't respond (==) as I wrote above, can anyone help

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

11 hours ago, XkPP said:
function SPD()
if _bsd_8 == "ue0" then gg.alert("1") end
if _bsd_8 == "ue1" then gg.alert("2") end
if _bsd_8 == "ue2" then gg.alert("3") end
end

local DO = gg.alert("Select:","a","b","c")
if DO == 1 then _bsd_8 = "ue0", SPD() end
if DO == 2 then _bsd_8 = "ue1", SPD() end
if DO == 3 then _bsd_8 = "ue2", SPD() end

so it doesn't respond (==) as I wrote above, can anyone help

Delete ,

Like this so this should work

function SPD()
if _bsd_8 == "ue0" then gg.alert("1") end
if _bsd_8 == "ue1" then gg.alert("2") end
if _bsd_8 == "ue2" then gg.alert("3") end
end
local DO = gg.alert("Select:","a","b","c")
if DO == 1 then _bsd_8 = "ue0" SPD() end
if DO == 2 then _bsd_8 = "ue1" SPD() end
if DO == 3 then _bsd_8 = "ue2" SPD() end

 

Link to comment
Share on other sites

Never used a comma like that before, looks like it sets the value after the call, that's why its not equal (aka nil).

-- lua
_bsd_8 = "ue0", SPD() 

-- bytes code
LOADK       1 7	        ; "ue0"
GETTABUP    2 0 8	; _ENV "SPD"
CALL        2 1 1	; 0 in 0 out
SETTABUP    0 6 1	; _ENV "_bsd_8"

and

-- lua
_bsd_8 = "ue0" SPD() 

-- bytes code
SETTABUP    0 6 7k	; _ENV "_bsd_8" "ue0"
GETTABUP    1 0 8	; _ENV "SPD"
CALL        1 1 1	; 0 in 0 out

https://www.luac.nl/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.