if plr.leaderstats.SneakyPoints.Value > 4 then
plr.leaderstats.SneakyPoints.Value = plr.leaderstats.SneakyPoints.Value - 5
end
This happends because you are argumenting if a player has less than 4 points, then you are getting 5 of 4 points, so your leaderstats value will be in -1+.
Try to change if plr.leaderstats.SneakyPoints.Value > 4 then to if plr.leaderstats.SneakyPoints.Value < 4 then, thats your error!
local boosted = script.Parent.Boosted
local regular = script.Parent.Regular
local vip = script.Parent.VIP
local close = script.Parent.Close
local regularTicket = game.ReplicatedStorage.Tickets.Regular
local boostedTicket = game.ReplicatedStorage.Tickets.Boosted
local plr = game.Players.LocalPlayer
boosted.MouseButton1Click:Connect(function()
end)
regular.MouseButton1Click:Connect(function()
if plr.leaderstats.SneakyPoints.Value > 4 then
plr.leaderstats.SneakyPoints.Value = plr.leaderstats.SneakyPoints.Value - 5
local newTicket = regularTicket:Clone()
newTicket.Parent = game.Workspace:FindFirstChild(plr.Name)
end
end)
vip.MouseButton1Click:Connect(function()
end)
close.MouseButton1Click:Connect(function()
script.Parent.Visible = false
end)
script
local detector = script.Parent.ClickDetector
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
plr.PlayerGui.TicketUI.Frame.Visible = true
end)