So i found a script in where when a player touches a certain block, they get an item from the replicated storage. But when the player touches the block the block will keep on giving the player the item without a wait. What I want is the script to give the player the item but then to have a small wait (3 sec) so that when the player touches the brick it doesnt give the player like 5 swords, or 6 bow and arrows.
script.Parent.Touched:connect(onTouch)
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid and players[i].Backpack:FindFirstChild("GhostBurger") == nil then return players[i] end
end
return nil
end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human == nil) then return end
local player = getPlayer(human)
if (player == nil) then return end
game.ReplicatedStorage:findFirstChild("Bow and Arrow"):clone().Parent = player.Backpack
wait(10)
end
script.Parent.Touched:connect(onTouch)
i need help a

1 comment
if it worked, please accept the answer