local l = 0
game.ReplicatedStorage:WaitForChild("PickupItem").OnServerEvent:Connect(function(player, item, itemMins)
if l == 0 then
if player:WaitForChild("Data").Minutes.Value >= itemMins then
local newItem = item.Parent:Clone()
newItem.Parent = player.Backpack
newItem.Handle.Anchored = false
l ==1
else
player.PlayerGui.ScreenGui.Error.Visible = true
wait(0.5)
player.PlayerGui.ScreenGui.Error.Visible = false
print(itemMins)
print(item.Name)
end
end)
you can try my or if player can get this tool from other script try @JackscarIitt solution
local l = 0
game.ReplicatedStorage:WaitForChild("PickupItem").OnServerEvent:Connect(function(player, item, itemMins)
if l == 0 then
if player:WaitForChild("Data").Minutes.Value >= itemMins then
local newItem = item.Parent:Clone()
newItem.Parent = player.Backpack
newItem.Handle.Anchored = false
l = 1
else
player.PlayerGui.ScreenGui.Error.Visible = true
wait(0.5)
player.PlayerGui.ScreenGui.Error.Visible = false
print(itemMins)
print(item.Name)
end
end)