Ardit19 Posted February 9, 2023 Posted February 9, 2023 Trying to make a script that gets 2 values form user and then lua searches them automatically in dword. It gets the values but it doesn't search them! input = gg.prompt({"Type the HP of your Robot here!.", "Type the Speed of your Robot!"}, {[1]="0", [2]="0" }), {"number", "number"} gg.searchNumber({input[1] [2]},gg.TYPE_DWORD)
Proejder Posted February 10, 2023 Posted February 10, 2023 3 hours ago, Ardit19 said: Trying to make a script that gets 2 values form user and then lua searches them automatically in dword. It gets the values but it doesn't search them There is an error in the items specified in the search. the correct one should be specified as 1 and 2 like this local input = gg.prompt({"Type the HP of your Robot here!", "Type the Speed of your Robot!"}, {[1]=0, [2]=0}, {"number", "number"}) gg.searchNumber({input[1], input[2]}, gg.TYPE_DWORD)
MAARS Posted February 10, 2023 Posted February 10, 2023 I think the table.concat is more better way to do this 21 hours ago, Proejder said: gg.searchNumber({input[1], input[2]}, gg.TYPE_DWORD) you are missing one thing here, searchNumber await a string but you are passing a table, this will result an error, and also value group search are delimited with a semicolon ";" Sol: gg.searchNumber(table.concat(input, ";"), gg.TYPE_DWORD)
Question
Ardit19
Trying to make a script that gets 2 values form user and then lua searches them automatically in dword. It gets the values but it doesn't search them!
input = gg.prompt({"Type the HP of your Robot here!.", "Type the Speed of your Robot!"}, {[1]="0", [2]="0" }), {"number", "number"}
gg.searchNumber({input[1] [2]},gg.TYPE_DWORD)
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.