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

How to make a script that gives you a sword?

I am trying to make a script that when you step on a block (part) it gives a sword.

2 answers

✓ Accepted answer
script.Parent.Touched:connect(function(t)
player = game.Players:GetPlayerFromCharacter(t.Parent)
if player then
wait()
game.Lighting["Sword"]:Clone().Parent = player.Backpack
end
end)

Hope I helped!

2 comments

0

Put the script in the brick, if this does not work try using in localscript/regular script whichever you used.

0

Change the Sword inside the "" to whatever tool. NOTE: It'll work with tools/hopperbins maybe localscripts (KeyDown/KeyUp, etc.)

script.Parent.Touched:connect(function(hit)
char = hit.Parent
if char then
wait()
game.Lighting["Sword"]:Clone().Parent = char
end
end)

if ya need it Equipped Automatically...

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