Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't my SwordGiver brick work?

I put this script (Below) into a part called: SwordGiver

function OnTouched(Part) h = Part.Parent:FindFirstChild("Humanoid") if h~= nil then Sword = game.ServerStorage.LinkedSword:Clone() Sword.Parent = game.Players:FindFirstChild(Part.Parent.name).Backpack

end

end

script.Parent.Touched:connect(OnTouched)



The LinkedSword is in the ServerStorage
I Test Solo, and when my player walks across it, nothing happens, help?

3 comments

0

Why did that script mess up?

0

Idk...

0

3rd line. Look at the "name" it should be "Name"

1 answer

local db=false--Here's a debounce
script.Parent.Touched:connect(function(Part)
if not db then
db=true
h = Part.Parent:FindFirstChild("Humanoid") 
if h then 
Sword = Game.ServerStorage.LinkedSword:Clone() 
Sword.Parent = game.Players:FindFirstChild(Part.Parent.Name).Backpack --You need to capitalize "Name"...
end
db=false
end
end
) 

This discussion is preserved as it was. New answers, comments, and votes are closed.