everything is working fine on the script, but only the names of maps are not displaying. Any help will be appreciated.
code (one of the choices):
local player = game:GetService("Players").LocalPlayer
local voted = player:WaitForChild("voted")
local rep = game:GetService("ReplicatedStorage")
local votere = rep:WaitForChild("RemoteEvent"):WaitForChild("Vote")
local variables = rep:WaitForChild("Variables")
local boolean = rep:WaitForChild("Booleans"):WaitForChild("RevealVotes")
local choice = variables:WaitForChild("Choice2")
local votechoice = variables:WaitForChild("VoteChoice2")
local votescounter = script.Parent:FindFirstChild("Votes")
local map = choice.Value
if choice.Value then
script.Parent.Title.Text = map.Name
end
choice:GetPropertyChangedSignal("Value"):Connect(function()
local map = choice.Value
if choice.Value then
script.Parent.Title.Text = map.Name
end
end)
I’m having a hard time telling how your script is laid out, but I might have an idea of what’s wrong. Assuming the choice variable is a reference to an ObjectValue that points to another Value on the server, your script isn’t working because the client can’t see some server-side items. You need to move the maps into ReplicatedStorage so the player can see them (but be warned, scripts and such in ReplicatedStorage can be seen and downloaded by exploiters).
Using a lot of ValueObjects like this is rarely the best strategy. You’re much better off using a RemoteEvent and firing all clients with a table containing all the relevant info.
I made a system, where, before the voting starts, the maps are transferred to the workspace, and after that it is sent back to ServerStorage, where when the voting ends, only the “winning” map will be removed and taken to the workspace, thus making the map names to be displayed on the GUI the way I wanted. Thanks for helping me.
I’m having same issue on my topic about my voting system, the difference between mine I’m using viewport frames to preview map the problem is I couldn’t get replicate models that parented to server storage to clients any alternatives with my problems without using images or moving these on replicated storage?
I’ll try to clone the model on server side but don’t parent it on any yet, then on client side parent it where you want it to put, I think it’ll works.
-- Server
Map = ServerStorage.Model:Clone()
RemoteEvent:FireAllClients(Map)
-- Client
function Retrieve(Map)
Map.Parent = game.Workspace
end
RemoteEvent.OnClientEvent:Connect(Retrieve)