Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a script that gives you a sword?

Asked by 10 years ago

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

2 answers

Log in to vote
5
Answered by 10 years ago
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!

0
Put the script in the brick, if this does not work try using in localscript/regular script whichever you used. fireboltofdeath 635 — 10y
0
Change the Sword inside the "" to whatever tool. NOTE: It'll work with tools/hopperbins maybe localscripts (KeyDown/KeyUp, etc.) fireboltofdeath 635 — 10y
Ad
Log in to vote
-2
Answered by
KAAK82 16
10 years ago
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...

Answer this question