Localplayer in normal script

Hi, how can I call a localplayer in a normal script for the votingSystem (here in big text)
Thanks when you can help.

local rep = game:GetService(“ReplicatedStorage”)
local plrs = game:GetService(“Players”)
local plr = game.Players:WaitForChild(“LocalPlayer”)

local votingSystem = plr:WaitForChild(“StarterGui”).Gui.Voting

local status = rep.Status

local redTeam = game.Teams[“Red Team”]
local blueTeam = game.Teams[“Blue Team”]
local blueTeamColor = Color3.new(0.219608, 0.121569, 0.976471)
local redTeamColor = Color3.new(0.807843, 0, 0.0117647)

local lobbyTeam = game.Teams.Lobby

local choices = votingSystem:GetChildren()
local maps = rep.Maps:GetChildren()

local intermission = 10

local isAnOption
local randomMap

local chosenMap
local mapClone

local BlueTeamCount
local RedTeamCount

– picking a random map function
local function PickRandomMap ()

local randomNumber = math.random(1, #maps)

randomMap = maps[randomNumber]

return randomMap.CanBeVoted

end

for i, choice in pairs(choices) do

local name = choice.label
local picture = choice.Button.ImageLabel

isAnOption = PickRandomMap()

if isAnOption.Value == true then
	repeat 
		isAnOption = PickRandomMap()
	until
	isAnOption.Value == false
	name.Text = randomMap.Name
	picture.Image = randomMap.Image.Value
	randomMap.CanBeVoted.Value = true
	
else
	name.Text = randomMap.Name
	picture.Image = randomMap.Image.Value
	randomMap.CanBeVoted.Value = true		
end					

end

1 Like

you can use a LocalScript to vote and a RemoteeEvent so the server can change the votes

1 Like

First thing I believe in this scenario you would want to use a module script and you can always reference that player in a function such as:

Local function roundvote(player)
- Vote system here
 Local Player = player
end)

i will try it later and I give feedback
thanks