For some reason it says Value is not a valid member of remote event even though it is a IntValue

So I have two IntValues Classic and Teams, but when I test the script it says Value is not a valid member of RemoteEvent even though they are both IntValues!

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.

2 Likes

What does this has to interfer with that?

This may not be the cause, but rename the variable “status,” as you are overriding lua

It didn’t seem to do that though.

At least not in studio.

1 Like

At what line are you having the error?

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

1 Like

@Scepter_ofDarkness @PhoenixRessusection and @Arkrei sorry for the last reply… (I will add this above) the error is the two lines after while wait() do part

Check if there is a remote event called Classic or Teams

I already checked, there is only an intValue called that

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

edit: Misread the initial post

Now this is what it says: Players.Kamlkaze_Kid.PlayerGui.VotingSystem.Frame.LocalScript:25: attempt to index number with ‘Value’

Then you are getting the number, could you paste line 25 here?

script.Parent.Classic.TextLabel.Text = Classic.Value.Value …" Votes"

Sorry I misread the initial post, in which line are you getting the error described in the title?

script.Parent.Classic.TextLabel.Text = Classic.Value …" Votes"
script.Parent.Teams.TextLabel.Text = Teams.Value …" Votes"

Never mind, I was very stupid and realized that there was a name.