Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to make a script that gives you a sword?

Asked by 6 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 6 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 630 — 6y
0
Change the Sword inside the "" to whatever tool. NOTE: It'll work with tools/hopperbins maybe localscripts (KeyDown/KeyUp, etc.) fireboltofdeath 630 — 6y
Ad
Log in to vote
-2
Answered by
KAAK82 16
6 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