|
| 13 Mar 2016 10:28 AM |
this script is for a vote to change the map gui: Votes = Instance.new("Model", game.Workspace) Votes.Name = "Votes";
function Vote() for i,v in pairs(game.Players:GetPlayers()) do game.Lighting.VOTER:Clone().Parent = v.PlayerGui; end end
if somehowthevotingtimeisready then--change this to whatever you do to check if its time to vote Vote() repeat wait() until #game.Workspace.Votes:GetChildren() == game.Players.NumPlayers wins = {"","",""}--Put whatever you put in the strings HERE EXACTLY what the values are. counts = {0,0,0}--however many indexes the table wins has for i,v in pairs(game.Workspace.Votes:GetChildren()) do for u, p in pairs(wins) do if p == v.Value then counts[u] = counts[u] + 1; end end end for j, k in pairs(counts) if k == math.max(unpack(counts)); then winind = math.max(unpack(counts)); WINNERMAP = wins[winind]; -- will choose the string map. end end if WINNERMAP == "AMAPSNAME" then chosenmap = game.Lighting.MAPTHATMATCHESITSNAME end if WINNERMAP == "AMAPSOTHERNAME" then chosenmap = game.Lighting.MAPTHATMATCHESITSNAME Where does it go
Loganv450505, not good at LUA but is really nice and good at grammar |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2016 10:29 AM |
Bump (I also need to know is it module., local or regular script?)
Loganv450505, not good at LUA but is really nice and good at grammar |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2016 10:31 AM |
| Logan, you need to change the if statement before you do anything. |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2016 10:32 AM |
what do you mean? it was part of the code a friend gave me
Loganv450505, not good at LUA but is really nice and good at grammar |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2016 11:32 AM |
Bump
Loganv450505, not good at LUA but is really nice and good at grammar |
|
|
| Report Abuse |
|
|