So im making a tool shop for my game, but it seems to be not working after a change i made to cost survivals, could anyone help me?
The script
local MainFrame = script.Parent.MainFrame
local ScrollingFrame = MainFrame.ScrollingFrame
local player = game.Players.LocalPlayer
local CloseButton = MainFrame.TextButton
ScrollingFrame.Pistol.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 125 and player.leaderstats.Survivals.Value > 25 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 125
game.ReplicatedStorage.Pistol:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.SupplyGun.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 85 and player.leaderstats.Survivals.Value > 10 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.CallSupplyDrop:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.M4A1.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 280 and player.leaderstats.Survivals.Value > 45 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.M4A1:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.Ak47.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 280 and player.leaderstats.Survivals.Value > 75 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.Ak47:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.ScarL.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 500 and player.leaderstats.Survivals.Value > 125 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.ScarL:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.StunBaton.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 150 and player.leaderstats.Survivals.Value > 10 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.StunBaton:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.Axe.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 250 and player.leaderstats.Survivals.Value > 50 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 300
game.ReplicatedStorage.Axe:Clone().Parent = player.Backpack
end
end)
ScrollingFrame.Eerie.Buy.MouseButton1Click:Connect(function()
if player.leaderstats.Coins.Value > 1000 and player.leaderstats.Survivals.Value > 5 then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 1000
game.ReplicatedStorage.Eerie:Clone().Parent = player.Backpack
end
end)
It would be cool if anyone could help me