**Hey, Coders! So Basically my code isn't quite working, here is the code: UPDATE: THE CODE WORKS NOW IT TURNS OUT I HAD TO REARRANGE THE CODE **
game.Players.PlayerAdded:Connect(function(plr)
local door = game.Workspace.Map.Gate
local Sign = door.Sign
local coins = plr:WaitForChild("leaderstats").Honey
local dif = 2000000
local text = script.Parent.SIGN
coins.Changed:Connect(function(changed)
print("detected")
if dif > coinsValue then
text.Text = "You need "..AddCommas(coins.Value - dif).." More coins to access this area"
if coins.Value > 2000000 then
print("unlocked area")
text.Text = "Area Unlocked"
door.Door.CanCollide = false
Sign:Destroy()
door.Door.BrickColor = BrickColor.new(0, 191, 0)
end
end
end)
end)
So the problem is whenever the player hits more than 2,000,000 coins nothing happens even though i scripted what happens next nothing happens here is the code:
if coins.Value > 2000000 then
print("unlocked area")
text.Text = "Area Unlocked"
door.Door.CanCollide = false
Sign:Destroy()
door.Door.BrickColor = BrickColor.new(0, 191, 0)
any help would be awesome!

1 comment
Sorry, didn't see the Update.