Jump to content
  • 0

Can anyone help me with this?


Ardit19

Question

Posted

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

Posted
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)

 

Posted

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)

 

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.