this is a local script
local player = game.Players.LocalPlayer local RE = game.ReplicatedStorage.EnterCode --EnterCode Is RemoteEvent local codes = player:WaitForChild("Codes") local codelist = { code1 = "ROBLOX", --Test Codes code2 = "Yeet" } script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.CodeHandler.Text == codelist.code1 then if not codes:FindFirstChild ("Code1") then RE:FireServer(20, "Code1") --Rewards script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" end else script.Parent.Text = "Code Expired" wait(2) script.Parent.Text = "Redeem Code" end elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then if not codes:FindFirstChild ("Code2") then RE:FireServer(20, "Code2")--Rewards script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" end end end)
THIS IS NOT ANSWER, THIS IS HIS CODE INTO A CODEBLOCK
local player = game.Players.LocalPlayer local RE = game.ReplicatedStorage.EnterCode --EnterCode Is RemoteEvent local codes = player:WaitForChild("Codes") local codelist = { code1 = "ROBLOX", --Test Codes code2 = "Yeet" } script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.CodeHandler.Text == codelist.code1 then if not codes:FindFirstChild ("Code1") then RE:FireServer(20, "Code1") --Rewards script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" end else script.Parent.Text = "Code Expired" wait(2) script.Parent.Text = "Redeem Code" end elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then if not codes:FindFirstChild ("Code2") then RE:FireServer(20, "Code2")--Rewards script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code Redeemed Successfully" wait(2) script.Parent.Text = "Redeem Code" end end end)