I don't want players to be able to enter the code again if they leave then rejoin. Would I need to use datastores?
local codes = script.Parent.Parent.Codes -- location of the codes script.Parent.MouseButton1Down:Connect(function() if script.Parent.Parent.codeBox.Text == "Alpha" then if codes.Alpha.Value == true then script.Parent.Parent.codeBox.Text = "Already Redeemed!" end if codes.Alpha.Value == false then codes.Alpha.Value = true game.Players.LocalPlayer.leaderstats.Credits.Value = game.Players.LocalPlayer.leaderstats.Credits.Value + codes.Alpha.Reward.Value -- change Credits to your currency's name and the number to how much you want to award them for entering the code. script.Parent.Parent.codeBox.Text = "Redeemed!" end end end)
Also my game is Filtering Enabled.
Line 10.
player.leaderstats.Credits.Value + codes.Alpha.Reward.Value