Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Second value doesn't decrease?

Asked by
2_MMZ 1059 Moderation Voter
3 years ago

Hello. I'm remastering a game(which will remain anonymous for now.) The game features a map voting, and a countdown. When the player clicks the vote button, it allows them to add a vote, and only one. (Which works). The other part of the script constantly changes the "timeleft" text to "val2" which is how much time is left. But that doesn't work. Can I get any assistance on this? Here's my code:

01local remEvent = game.ReplicatedStorage.Remotes:WaitForChild("RemoteEvent")
02local remEvent2 = game.ReplicatedStorage.Remotes:WaitForChild("RemoteEvent2")
03local val = script.Parent.votin.votes.votesgiven
04local val2 = script.Parent.votin.timeleft.decreasing
05local gui = script.Parent
06 
07remEvent.OnServerEvent:Connect(function()
08    for i = 1,1 do
09        val.Value = val.Value + 1
10    end
11    print(val.Value)
12    script.Parent.votin.votes.Text = ""..val.Value
13end)
14 
15remEvent2.OnServerEvent:Connect(function()
View all 23 lines...

Any working answer is appreciated.

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Change line 22 from

1script.Parent.votin.timeleft.Text = ""..val2.Value

to

1script.Parent.votin.timeleft.Text = val2.Value

If that doesn't work then try this

copy lines 20-23 and delete lines 20-23 then create another script that is the same parent as the original script

Then paste in lines 20-23 on the new script

Ad

Answer this question