Hi everyone. I’m making a game where a map is chosen. Currently the map is randomly chosen, (I followed a youtube tutorial for this) but I wanted to integrate voting into this. I have made the Gui, and here it is:
This is the explorer (in case you provide code):
And this is the script for randomly choosing a map:
local lobby = game.Workspace.Lobby
local maps = game.ReplicatedStorage.Maps:GetChildren()
local status = game.ReplicatedStorage.Status
while true do
for i = 20, 0, -1 do
status.Value = "Intermission: "..i
task.wait(1)
end
local chosenmap = maps[math.random(1,#maps)]
local clonedmap = chosenmap:Clone()
clonedmap.Parent = game.Workspace
status.Value = "The map is "..clonedmap.Name
task.wait(3)
for i, Player in pairs(game.Players:GetPlayers()) do
local char = Player.Character
if char then
local humroot = char.HumanoidRootPart
humroot.CFrame = clonedmap.TeleportPoint.CFrame
end
end
for i = 10, 0, -1 do
status.Value = i
task.wait(1)
end
for i, Player in pairs(game.Players:GetPlayers()) do
local char = Player.Character
if char then
local humroot = char.HumanoidRootPart
humroot.CFrame = lobby.TeleportPoint.CFrame
end
end
clonedmap:Destroy()
end
This is a local script that the tutorial made me write, but isn’t necessarily to do with the random map choosing:
local status = game.ReplicatedStorage:WaitForChild("Status")
local label = script.Parent.TextLabel
status:GetPropertyChangedSignal("Value"):Connect(function()
label.Text = status.Value
end)
I want to change this from random to voting. Does anyone know how I could do this, and if possible provide a script? I am aware that this could possibly be an inconvenience to help me with, and that’s why I truly thank anyone who can help me out here. Thanks!