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

How do I make it where when you touch a brick it remove your sword only your sword?

I need help with this if you could help I'll be thankful. Thanks!

6 comments

0

Where is the sword, In StarterPack? Make sure you add more detail into your questions to help us out.

0

Also is just just called "Sword"?

0

Like I want to make it like when the player touches the brick the only thing that disappear is his/her sword. Nothing eles but her/his sword.

0

Hold on

0

ok

0

Here's the deal my friend, you are actually requesting a script right now. This website dosen't alow you to do that.

1 answer

✓ Accepted answer
function onTouch(part) 
	local Player = game.Players:FindFirstChild(part.Parent.Name)
	if Player ~= nil then
	local Sword = part.Parent:FindFirstChild("Sword") 
	local SwordInBackpack = Player.Backpack:FindFirstChild("Sword") 
	if (Sword ~= nil) then
		Sword:Destroy()
	end 
	if (SwordInBackpack ~= nil) then
		SwordInBackpack:Destroy()
	end 
	end
	
end

script.Parent.Touched:connect(onTouch)

This should work

6 comments

0

Do I put this in script and put it in a brick?

0

Yes

0

Ok thank you

0

np

0

magemasterhd it didn't work

0

what is the error

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