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

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

Asked by 4 years ago
Edited 4 years 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