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

What's wrong with this Choosing Maps script? [NOT SOLVED]

Asked by 10 years ago
Forest = game.Lighting.Forest
Trusses = game.Lighting.Trusses
Maps = {Forest, Trusses}
function ChooseMaps()
        game.Players:GetPlayers(player)
        randmap1 = math.random(1, #Maps)
        randmap2 = math.random(1, #Maps)
        while randmap1 == randmap2 do
            randmap2 = math.random(1, #Maps)
        end
        player.PlayerGui.VoteMap.Frame.Map1.Text = Maps[randmap1].Name
        player.PlayerGui.VoteMap.Frame.Map2.Text = Maps[randmap2].Name
        player.PlayerGui.VoteMap.Frame.Visible = true
    end

Okay, so, I don't think anything in this script it working. What it's supposed to do is it's gonna pick a random two maps out of the table "Maps" (yes, I'll add more), and then have the name of the maps be on the buttons on which you would vote for which one you would want most (adding that later), and then make the whole Gui visible. But NONE of this seems to be working... And nothing's showing up in the output either.

If you could figure out what's wrong with this, I would be very grateful.

1 answer

Log in to vote
1
Answered by
AxeOfMen 434 Moderation Voter
10 years ago

Line 6: game.Players:GetPlayers(player)

The GetPlayers function does not take any arguments. You are passing in "player" which is undefined in the script you've shown.

0
So then what WOULD work for what I'm trying to do? ImmenseKassing 120 — 10y
0
Okay, but what would I do to FIX it? What would I replace that with? ImmenseKassing 120 — 10y
0
It depends on what you are trying to do. Is this a Localscript or a server script? Is this single script responsible for displaying the gui to all players or to just the local player? AxeOfMen 434 — 10y
Ad

Answer this question