script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local LinkedSword = game.ServerStorage.ClassicSword:Clone()
LinkedSword.Parent = player.Backpack
end)
✓ ANSWER ACCEPTED
how do i make it so i dont get the linked sword more than one time?
1 answer
✓ Accepted answer
What you need is a debounce to make sure people won't get the sword more than once on accident:
local debounce = false
script.Parent.Touched:Connect(function(hit)
if not debounce then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local LinkedSword = game.ServerStorage.ClassicSword:Clone()
LinkedSword.Parent = player.Backpack
wait(3)
debounce = false
end
end)
Hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Use delay() instead of wait(3), cause he is gonna get problems if he scripts something below this function
i need a limit