if script.Parent.Text == ("BETAISRELEASED") then game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.MouseButton1Click:Connect(function() game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Succesfully Redeemed!") wait(2) game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Redeem") end
i'm trying to make a code system it isnt working and i dont know why
title:
Players.JAX_AtRB.PlayerGui.Menu.MainMenu.CreditsFrame.CodeBar.LocalScript:7: Expected ')' (to close '(' at line 3), got <eof>
You inversed the places for the ends of each code block.
Correct version:
local player = game.Players.LocalPlayer local PlayerGui = player:WaitForChild("PlayerGui") if script.Parent.Text == ("BETAISRELEASED") then PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.MouseButton1Click:Connect(function() PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = '("Succesfully Redeemed!") ' wait(2) PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = '("Redeem")' end) end
you actually need to do player.PlayerGui
b/c all the GUIs in StarterGui are cloned into the Player.PlayerGui
for every player that joins.. all visible GUIs in Player.PlayerGui
will display on the player's screen
The problem is you didn't close off the function call: jhere is your code rewritten:
local player = game.Players.LocalPlayer local PlayerGui = player.PlayerGui if script.Parent.Text == ("BETAISRELEASED") then PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.MouseButton1Click:Connect(function() PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Succesfully Redeemed!") wait(2) PlayerGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Redeem") end end)
if script.Parent.Text == ("BETAISRELEASED") then game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.MouseButton1Click:Connect(function() game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Succesfully Redeemed!") wait(2) game.StarterGui.Menu.MainMenu.CreditsFrame.RedeemCode.Text = ("Redeem") end) end
you forgot to close the function lol also read the answer above. It is also useful. It's cloned into the player's PlayerGUI so that script might not work if you don't set it as game.Players.LocalPlayer.PlayerGUI.Menu
edit: sorry made a mistake script fixed