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

Trying to make it so if the player has already voted he cant vote again. no error why no work?

Asked by 3 years ago

When removing the part that checks if they already voted they can still add a value to the gui ot click it but when i added the top part that checks when i try to vote it doesnt work.

VOte option 1:

if game.Players.Localplayer.PlayerGui.Modes.Classic.ImageButton.Script.Disabled == true then
    script.Disabled = true
else
    if workspace.Timer.Value >= 0 then
        function leftClick()
            workspace.CatMaidMania.Value = workspace.Classic.Value + 1
            script.Disabled = true
        end
    end
end

script.Parent.MouseButton1Click:Connect(leftClick)

Vote option 2:

if game.Players.Localplayer.PlayerGui.Modes.CatMaidMania.ImageButton.Script.Disabled == true then
    script.Disabled = true
    else
if workspace.Timer.Value >= 0 then
    function leftClick()
    workspace.Classic.Value = workspace.Classic.Value + 1
    script.Disabled = true
    end
    end
    end

    script.Parent.MouseButton1Click:Connect(leftClick)

Im fairly new to scripting; messy code :p

0
why would a part check if someone already voted? just use a bool value and set the name of the value to the player name that voted, then check the value and if its already true, then they already voted AlexanderYar 788 — 3y
0
heh thanks i dont know what a bool value is but ill look it up on youtube and on the dev forum Radiant_Sparkles 69 — 3y

Answer this question