Hello, I ran into a problem where my UI does not show up. I do not know why it does not show up but I will provide the script so anyone can take a look at it. Any help is appreciated.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--//Variables
local RemoteEvent = ReplicatedStorage.purchaseConfirmation.Mushroom
--//Functions
RemoteEvent.OnServerEvent:Connect(function(Player)
--//Variables
local popStarters = Player:WaitForChild("worldStats").StartingValue
local popPoints = Player:WaitForChild("leaderstats").Pops
local requiredXP = Player:WaitForChild("worldStats").PopsRequired
local debounce = false
--//Details
popPoints:GetPropertyChangedSignal("Value"):Connect(function()
local playerGui = Player:WaitForChild("PlayerGui")
task.wait(0.1)
if debounce == false then
debounce = true
if popPoints.Value >= requiredXP.Value then
if Player.worldStats.boughtMushroom.Value == "false" then
if Player.tutorialStats.didTutorial.Value == "true" then
if Player.worldStats.unlockedMushroom.Value == "false" then
local confirmationUI = script:WaitForChild("MushroomUnlocked"):Clone()
confirmationUI.Parent = playerGui
Player.worldStats.boughtMushroom.Value = "true"
Player.worldStats.unlockedMushroom.Value = "true"
debounce = true
end
end
end
end
end
end)
end)