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

How to make a script give you sword when a duel start ? [closed]

Asked by 10 years ago

How do i make script that give me a sword

0
well i want it to give players sword when they touch a brick decade111 5 — 10y

Closed as Too Broad by 2eggnog, fireboltofdeath, and Shawnyg

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Well, elaborate a bit. How do you want the game to know wehn to give you the sword. By touching a brick? When a value has reached a certain specified point? Start of the server? When you join?

Getting the sword is easy. Store it in lighting and use the clone method to get a copy of the sword into your backpack;

game.Lighting:FindFirstChild("Linked Sword"):Clone().Parent = game.Players.decade111.Backpack
--Replace 'Linked Sword' with whatever the sword is named.

But again, elaborate a bit. When do you want the sword.

0
when i touch the brick i wanna get a sword decade111 5 — 10y
Ad
Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago

Okay, you want to give a player a sword when they touch a brick. I will create the script for you but I will also tell you what everything does and how it's set up.

brick = script.Parent -- this is the brick that you want to be touched to give you a sword.
sword = game.Lighting:FindFirstChild("Sword") -- Put the sword in lighting. You will see why soon.

brick.Touched:connect(function (player)  -- what this says is when the brick is touched it will 'fire' the function, or make the function activate.
if player.Character.Humanoid then -- this will make sure that it doesn't just give it to a brick.
local give = sword:clone() -- this is creating a clone of the sword.
give.Parent = player.Backpack -- this is putting the sword into the player's backpack
end
end) -- this ends the function

All you have to do is put a script inside the brick and paste this inside the script. Along with putting a sword in lighting and having it be named 'Sword'.

Please +1 if this has helped you! :D

0
thanks buy how can i repeat this decade111 5 — 10y
0
repeat what exactly? lomo0987 250 — 10y
0
oh man it didn't work decade111 5 — 10y
0
can you make another script ? decade111 5 — 10y
View all comments (4 more)
0
What was the error? lomo0987 250 — 10y
0
i step on it and nothing happen decade111 5 — 10y
0
no error? lomo0987 250 — 10y
0
anything yet ? decade111 5 — 10y