✓ Accepted answer
Based on your description, I think this is similar to what you're looking for:
local Tool = game:GetService("ServerStorage").Tool
local Debounces = {}
local Time = 10
script.Parent.ClickDetector.MouseClick:connect(function(Player)
if Debounces[Player.Name] then
print(Player.Name .. " is not eligible for a tool yet.")
return
end
local Backpack = Player:FindFirstChild("Backpack")
if Backpack then
local Check = Backpack:FindFirstChild(Tool.Name) or Player.Character:FindFirstChild(Tool.Name)
if not Check then
Debounces[Player.Name] = true
Tool:Clone().Parent = Backpack
print(Player.Name .. " has recieved the tool: " .. Tool.Name)
wait(Time)
Debounces[Player.Name] = nil
print(Player.Name .. "can now get another tool.")
end
end
end)
This will not give the player the tool if she/he already has it.
If you don't have it and try to get it before x seconds is passed, you will not be able to get it.
1 comment
Nice, very good script. Thank you!