local Classic = game.ReplicatedStorage.Classic
local Teams = game.ReplicatedStorage.Teams
local VotingOn = game.ReplicatedStorage.VotingOn
local status = game.ReplicatedStorage.VotingStatus
local Vote = game.ReplicatedStorage.Vote
local chosen
script.Parent.Classic.MouseButton1Click:Connect(function()
if chosen ~= "Classic" then
game.ReplicatedStorage.Vote:FireServer(chosen, "Classic")
chosen = "Classic"
--script.Parent.Visible = false
end
end)
script.Parent.Teams.MouseButton1Click:Connect(function()
if chosen ~= "Teams" then
game.ReplicatedStorage.Vote:FireServer(chosen, "Teams")
chosen = "Teams"
--script.Parent.Visible = false
end
end)
while wait() do
script.Parent.Classic.TextLabel.Text = Classic.Value .." Votes"
script.Parent.Teams.TextLabel.Text = Teams.Value .." Votes"
end
This is a local script a child of a frame.
The error is the two lines after while wait() do part
A little more information would be more beneficial in finding the solution to your problem, what line is the root of the problem, I personally can’t yet see an issue with the provided piece of code.
Maybe a view of your hierarchy in the explorer might also help us out, could you show us the remote event and the values from the explorer view and provide which lines is causing the problem.
In the while wait() loop, print Classic.ClassName, and Teams.ClassName to make sure that they actually are an intvalue and you aren’t referencing the wrong object
Just a thing but you couldve done the if chosen ~= “Teams” inside the first event
But you would just have to do elseif chosen ~= “Teams”
(This is good for cleaning memory and rename the status variable since it can give problems)
Well the problem would be in having something called Teams or Classic thats on the replicated storage thats a remote event, since there are no remote events called that then I cant really know what it is
You forgot to add an extra .Value indexing:
You have a IntValue called “Value”, you index it with the first .Value but because you never try to acquire a property of it (like the value property) with a reference to a property of said value, the line is interpreted as you trying to access a Value property in the event
tldr: The correct line would then be
Teams.Value.Value