New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

My script isnt working. Expected identifier got ( Whats wrong?

Asked by 14 days ago
Edited 14 days ago

trying to make a coinflip script. It says the expected identifier.

``local x = math.random(1,2) local n = tonumber(v.PlayerGui.ScreenGui.TextBox.Text) script.Parent.MouseButton1Click:Connect(function() for i, v in pairs(game.Players:GetPlayers())do if v:FindFirstChild("leaderstats")then if v:FindFirstChild("PlayerGui")then if v.PlayerGui.ScreenGui.TextBox.Text == "0" then print("") else local n = tonumber(v.PlayerGui.ScreenGui.TextBox.Text) if v.leaderstats["Coins"].Value > n then

                        if x == 1 then

                            v.leaderstats["Coins"].Value = v.leaderstats["Coins"] + n
                    else

                                v.leaderstats["Coins"].Value = v.leaderstats["Coins"] -  n

                                    end
                        end
                    end
            end
        end
    end)
end)

end)

Answer this question