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

How do I make it where when you touch a brick it gives a sword? [closed]

Asked by 10 years ago

I need help making a script that gives a sword when you touch a brick.

Closed as Not Constructive by Articulating and evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

6 answers

Log in to vote
0
Answered by 10 years ago

I need all the help I can get, Thanks.

Ad
Log in to vote
0
Answered by
Mr1Vgy 30
10 years ago

Here's what I think: First of all put a sword in the lighting and name it "Sword" then make a part in the Workspace and put this script in it:

script.Parent.Touched:connect(function(hit)
local find = hit.Parent:FindFirstChild("Humanoid")
if find then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local findS  = player.Backpack:FindFirstChild("Sword")
if not findS then
local sword = game.Lighting.Sword:Clone()
sword.Parent = player.Backpack
end
end
if not find then
print('no humanoid')
end
end)
Log in to vote
-1
Answered by 10 years ago

Here's my answer: What you're talking about is a giver. Here I have a link that'll get you started maybe without a script: http://www.roblox.com/Basic-Giver-item?id=3140741

0
You're welcome. EvIlBrainBug 0 — 10y
0
I'm not wanting a giver, but I think I found my answer. When people get chose to go into the arena, I put the sword into lightning. InterferingWinds 0 — 10y
Log in to vote
-1
Answered by
reaper5 10
10 years ago

(put inside the brick to be hit)

Incase you are still wondering;

local spam_prevention = false
script.Parent.Touched:connect(function(hit)
    print("Reaper5 was here")
IsPlayer = hit.Parent.Parent:FindFirstChild("Humanoid")
if IsPlayer ~= nil then
    if spam_prevention == false then spam_prevention = true end

Tool_To_Give = game.Lighting.Sword:Clone() --Change "Sword" to what tool you want to be given
player_ = game.Players[hit.Parent.Parent.Name]

Tool_To_Give.Parent=player_.Backpack
wait(1)
spam_prevention=false
end
end)
Log in to vote
-1
Answered by 10 years ago

I recommend just using a free model.

Log in to vote
-1
Answered by 10 years ago

There are 2 ways you can do this, Insert a brick and name it Handle. (Do not do this if there is a part already in the tool) ~ OR ~ Create a brick then insert your tool in the brick. If there is already a brick in the tool it will be visible so hide somewhere that no one can see. (This will NOT affect the tool's handle position. It will attach to the character's arm.