Weird code error

So i made a Map Voting system, and there is a local script in every map vote option, everything works fine, except, that i want the title to be:

local choice = variables:WaitForChild("Choice1")
local map = choice.Value
warn(map)

what should happen is that the chosen map for slot 1 gets displayed, it wont be displayed.
image
and yes ofc i didnt forget a script in server script service:
image
well, the voting works, but i cant see which map im voting for, please help (and yes if i print the ServerScriptService choice 1 it works

Why do you have two loops for one thing?

there is more then that code going on
its going (the first and second loop) from line 14 to 92

Have you double-checked that the Choice1 is typed correctly within the WaitForChild() then?

yep, its typed correctly, here is the output,
image
(mars is the option 1), (nil is the client print of option 1), (camping is the chosen map, option 2)

Have you tried doing it client-side? since two options are both serverside meaning that If you do put it on a local script It may work.

1 Like

and here is proof that the map voting thing works:
image
the first “desert” is the map 1
the second is the chosen

Does an error pop up saying

Infinite yield possible on 'variables:WaitForChild("Choice1")'

i mean the local script is already there( in the middle), but if i do like the chosen map stuff, it would kinda work, but i wouldnt see the gui anymore, since voting is already over, but the title should be the chosen map, still not the way i want it to work

no, no error, nothing , thats why im asking you all

Ok if you do want it serverside then use

Game.Players.PlayerAdded:Connect(function(player)
to make sure that it is printed on the client.

Sorry, Excuse me i didn’t catch on. it took me so long reply I’m new!

can you run the game (in client) and screenshot where variables folder and Choice1 is located

Its in a folder called “variables” in replicated storage

since there’s not much information provided, just make sure you setted Choice1 Value BEFORE CLIENT.

try this

local choice = variables:WaitForChild('Choice1')
repeat wait() until choice.Value ~= nil
warn(choice.Value)

soon im back in Roblox studio, should i provide the whole code?

image
the client fires already right after the server script service script^
image

but is i paste his script inside the local script, it will break

image
(this is my ui layout)
image