So I’m trying to make the game check to see how many values in numbers the player has. If the player has less than 3 points, it gives the user the UI, if the player has 4 or more, the UI deletes itself. This is already connected to the data storage system.
I don’t know why, but when the game checks to see your points, if I have 4 points, the UI doesn’t delete but instead clones it as if I had less than 3 points. This is just making sure you can’t do the quest again once you have more than 3 points.
game.ReplicatedStorage.Events.SantaQuest.OnServerEvent:Connect(function(player)
local value = Instance.new ("Folder")
value.Name = "QuestInventory"
value.Parent = player
value = Instance.new ("IntValue")
value.Name = "Quests"
value.Parent = player.QuestInventory
print ("Folders created!")
if value.Value == 4 then
print ("Attempted to remove SantaQuest (Value == 4)")
elseif value.Value <= 3 then
player.PlayerGui.SantaQuest:Clone().Parent = player.PlayerGui
player.PlayerGui.SantaQuest.Enabled = true
print ("Player has redeemed this quest!")
end
If anyone knows how to solve this issue, feel free to reply, that’ll be great!