i was script in and i got a this error:bad argument #3 to 'Text' (string expected, got nil) the script is:
while true do local id = game.ReplicatedStorage.id:InvokeServer() if id[0] == 'game_tp' then script.Parent.Visible = true end if id[0] ~= 'game_tp' then script.Parent.Visible = false end wait(0.1) script.Parent.dec.Text = id[2] script.Parent.mapname.Text = id[1] end
this is the sever script:
function id() return {game.ServerScriptService.game_cmds_Value, game.ServerStorage.guis.map.map_no_id.thegui.mapname.Text, game.ServerStorage.guis.map.map_no_id.thegui.dec.Text} end game.ReplicatedStorage.id.OnServerInvoke = id
Lua table index starts at 1
not 0
so on line 10 you are trying to assing text to a nil value as the index id[2]
does not exist.
You should alos not be calling InvokeServer
in a while loop with a 0.1 wait time. Send the data when it is needed to all player and update them when it changes. Constantly calling remote events / functions will overload the network reulting in lag and dropped requests.
Please review your code and how you want it to work.
Lastly you should use else
with your if statment as you check if the first is equal. Better still as you are only assigning a boolean value and all comparison operators return a boolean use.
script.Parent.Visible = id[1] == 'game_tp' -- index should be 1
Hope this helps.