I don't understand why this happened? I have debounce and everything. This script is checking if the player owns a certain tool and if they do it'll make the equip button visible?
Any ideas why this is happening
Local Script
local Event = game.ReplicatedStorage.EggTrayEvents.PurchaseEggTray
local Price = script.Parent.Price.Value
local Storage = script.Parent.MaxStorage.Value
local Name = script.Parent.NameOFItem.Value
local Ownership = false
local Player = game.Players.LocalPlayer
local MC = Player:WaitForChild("MainCurrency")
local Coins = MC:FindFirstChild("Tokens")
local PouchCheck = Player:WaitForChild("EggTrayOwned")
local PouchEquipped = Player:WaitForChild("EggTrayEquipped")
local PE1 = PouchEquipped:WaitForChild("EggTray2E") -- Just Change The Num Each Time
local PO1 = PouchCheck:WaitForChild("EggTO2") -- Just Change The Num Each Time
local debounce = false
----------------------------
while debounce == false do
if MC and PO1.Value == false then
script.Parent.MouseButton1Click:Connect(function()
if Coins.Value >= Price then
debounce = true
Ownership = true
Event:FireServer(Name, Price, Storage, Ownership)
print("Fired")
script.Parent.Parent.PS:Play()
script.Parent.Visible = false
script.Parent.Parent.Equip.Visible = true
else
debounce = true
script.Parent.RoundIf.NameLab.Text = "Ins Tokens"
script.Parent.RoundIf.NameLab.TextColor3 = Color3.fromRGB(255,0,0)
script.Parent.Parent.ER:Play()
wait(1)
script.Parent.RoundIf.NameLab.Text = "BUY"
script.Parent.RoundIf.NameLab.TextColor3 = Color3.fromRGB(255,255,255)
debounce = false
end
end)
elseif MC and PO1.Value == true then
debounce = true
script.Parent.Visible = false
script.Parent.Parent.Equip.Visible = true
end
end

1 comment
??