Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

16:17:25.947 - Workspace.Main:58: bad argument #2 to '?' (string expected, got nil)?

Asked by 4 years ago
Edited by theking48989987 4 years ago

Imm hi I make minigame but this is code working first time but after I change the minigame time code gives this error 16:17:25.947 - Workspace.Main:58: bad argument #2 to '?' (string expected, got nil)

local s =script.Stat
local vals =game.ReplicatedStorage.Vals
t = 0
while true do
    t=15
    repeat
        t=t-1
        s.Value="Processing .."..t
        wait (1)


    until t == 0
    s.Value="ok you can start!"
    wait (0.1)
    t =50

    local mapselect =game.ReplicatedStorage.Maps1:GetChildren()
    local mapselectb =game.ReplicatedStorage.Maps2:GetChildren()
    local choose = math.random(1,#mapselect)
    local chooseb = math.random(1,#mapselectb)
    curnum =0
    curnumb = 0
    for i =1,#mapselect and #mapselectb do
        curnum = curnum+1
        curnumb = curnumb+1
        if curnum and curnumb == choose and chooseb then
            mapselect[i]:Clone().Parent = workspace
            mapselectb[i]:Clone().Parent = workspace
            curmap =mapselect [i].Name
            curmapb =mapselectb [i].Name
        end
    end
    wait(1)
    local plrs =game.Players:GetChildren()
        for i =1,#plrs do
            local num =math.random(1,12)
            plrs [i].Character.Head.CFrame =CFrame. new (workspace.Teleports["Part"..num].Position)
            plrs [i].Character.Parent =workspace.Ingame
        end
    repeat

        t=t-1
        s.Value=t.." second left"
        wait(1)

    until t==0 or vals.Winner.Value ~= ""
    if vals.Winner.Value ~= "" then
        s.Value =vals.Winner.Value.." has finished :F"
        game.Players[vals.Winner.Value].leaderstats.Wol.Value =game.Players[vals.Winner.Value].leaderstats.Wol.Value+10
        game.Players[vals.Winner.Value].leaderstats.Wins.Value =game.Players[vals.Winner.Value].leaderstats.Wins.Value+1
        wait(2)
        vals.Winner.Value = ""
    else
        s.Value =vals.Winner.Value.."no one finished"
        wait(2)
    end

    workspace[curmap and curmapb]:Destroy()

    local ingame =workspace.Ingame:GetChildren()
    for i =1,#ingame do
        local plr =game.Players:GetPlayerFromCharacter(ingame[i])
        plr:LoadCharacter()

    end
end

0
ummm which line is the error? 123nabilben123 499 — 4y
0
it says 58 gloveshun 119 — 4y
0
Maybe you forgot an end? cmgtotalyawesome 1418 — 4y

Answer this question