This is the code you wrote:
game.Players.PlayerAdded:connect(function()
if game.Players.LocalPlayer.leaderstats.Purchases.Value == 1 then
print("Hi")
game.StarterGui.ScreenGui.Frame1.Desert.Visible = true
else
game.StarterGui.ScreenGui.Frame1.Desert.Visible = false
end
end)
Let us make some fixes!
The only fix that is needed is the game.StarterGui.ScreenGui.Frame1.Desert.Visible and also game.Players.PlayerAdded if you want this to check whenever the player gets 1 purchase.
This usually is never used, instead, use this:
I'm gonna make a variable to shorten the game.Players.LocalPlayer.
local player = game.Players.LocalPlayer
player.PlayerGui.StarterGui.ScreenGui.Frame1.Desert.Visible =
Now with our fixed code the final code should be:
local player = game.Players.LocalPlayer
game.Players.PlayerAdded:Connect(function()
if player.leaderstats.Purchases.Value == 1 then
print("Hi")
player.PlayerGui.StarterGui.ScreenGui.Frame1.Desert.Visible = true
else
player.PlayerGui.StarterGui.ScreenGui.Frame1.Desert.Visible = false
end
end)
If you have any more questions please feel free to comment more than happy to help:)
1 comment
Unfortunately that didn't work either, here is what I want it to look like but none of the scripts I have tried work: This is what it looks like: https://ibb.co/0MmHShY and this is what it's supposed to look like: https://ibb.co/NYRpngM