Still doesn’t work and also no error from output.
Your code worked fine. It might be because Forgive’s or Blame’s text is something such as “9 Votes”, if it is the problem then you can use string.match to only get the number.
No, that is not the problem. I have a seperate text label for that.
My bad, you can try debugging your code. Tell me what’s in your output.
local bool = Gui.VoteGui.Frame.Forgive.NumberValue.Value > Gui.VoteGui.Frame.Blame.NumberValue.Value
print(bool)
if bool then
print("forgive is higher than blame")
else
print("blame is higher than forgive")
end
Sorry for late response. Let me try to test it.
It printed in the output, “true”. But I voted Blame.
And also it did not work sooooo
It still is not working even though I put multiple prints. It says I voted for the Forgive even though I did not
Also I mean that the prints say I voted for the forgive button.
Could you possibly show your full voting script?
local players = game.Players:getPlayers()
for _,player in pairs(players) do
if player.PlayerGui then
local Gui = player.PlayerGui
local bool = Gui.VoteGui.Frame.Forgive.NumberValue.Value > Gui.VoteGui.Frame.Blame.NumberValue.Value
print(bool)
if bool then
print("YOU VOTED FOR FORGIVE")
Gui.VoteGui.Frame.Visible = false
Gui.VoteGui.Frame.Visible = false
game.ReplicatedStorage.VoteEvent:Destroy()
Dialogue:FireAllClients(Monster_Image,"Thank you. I will bring everybody back.")
workspace.Deadman:Destroy()
game.ReplicatedStorage.Everybody.Parent = workspace
wait(8)
Dialogue:FireAllClients(Monster_Image,"Hello, everybody.")
wait(5)
local Man_Image = "http://www.roblox.com/asset/?id=7103581270"
Dialogue:FireAllClients(Man_Image,"It's.. you! I am sorry for killing you, I had to do it for money.")
wait(8)
local Monster_Image = "rbxassetid://5854700104"
Dialogue:FireAllClients(Monster_Image,"I forgive you.")
wait(8)
EndEvent:FireAllClients()
else
print("VOTED BLAME")
Gui.VoteGui.Frame.Visible = false
local Monster_Image = "rbxassetid://5854700104"
Gui.VoteGui.Frame.Visible = false
Dialogue:FireAllClients(Monster_Image,"...Goodbye.")
wait(5)
workspace.Monster:Destroy()
wait(5)
game.ReplicatedStorage.Police.Parent = workspace
wait(1)
local Police_Image = "http://www.roblox.com/asset/?
id=1483419652"
Dialogue:FireAllClients(Police_Image,"What have you done? Down to prison he goes.")
wait(5)
EndEvent:FireAllClients() -- blame is higher than forgive
This script is pretty messy, and it needs a lot of fixing. I also assume this isnt the entire code for your voting script, but I will go with what you have given. But if you can give the whole code, that would be better and I can help a lot sooner.
That is the whole code for the whole voting gui.
Okay, my bad.
At start, it would be better if you have the values stored inside of ReplicatedStorage. Instead of having to access the PlayerGui on the server, I would highly suggest you to have the voting values stored inside of ReplicatedStorage. Then you can easily mention the values in your scripts.
(I gtg sleep now, its getting pretty late. Ill catch you in the morning (EST))
Sorry, I dont understand what that means. Get your rest though.
Im back now!
Okay, so what I mean is that the Blame NumberValue and the Forgive NumberValue should be in ReplicatedStorage, not in the ScreenGui. It would be better because then you dont have to mention so much in your scripts, trying to get the Blame Value and the Forgive Value.
Code example:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BlameValue = ReplicatedStorage:WaitForChild("BlameValue")
local ForgiveValue = ReplicatedStorage:WaitForChild("ForgiveValue")
Its that simple to mention. So I suggest you move your NumberValues in ReplicatedStorage.
I see in the server script that you have given, you try to make a frame invisible. But that could be done on a local script by (or after) firing a remote event, right?
There are things that need to be fixed in your script urgently.
Hopefully this is understandable now
I understand now. Also, I will not be here for 3 days since I am going somewhere.
Okay, I am back from where I was now.
I have done everything. What do I do now?
Just needed to ask, where is the Dialogue and EndEvent remote events located in? I know its in ReplicatedStorage, but is it directly inside ReplicatedStorage, or is it like in a folder or something?
And what are the actual names of the remote events?