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

Remove tools on click of a brick? [closed]

Asked by
ahlxs -8
5 years ago

the title says it all

0
Post your code? hellmatic 1523 — 5y

Closed as Not Constructive by WideSteal321, DinozCreates, and User#24403

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?

2 answers

Log in to vote
0
Answered by 5 years ago

Put a click detector in the brick put a script in click detector in script put

script.Parent.MouseClick:Connect(function(p)
local plr = p:GetPlayerFromCharacter()
plr.StarterGear:ClearAllChildren()
plr.Backpack:ClearAllChildren()
end)

Sorry if there's an error I'm on phone.

0
umm i think you got this wrong because im pretty sure p is a player not a character HappyTimIsHim 652 — 5y
0
andyou would do :getPlayerFromCharacter() on plr:GetPlayers() HappyTimIsHim 652 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Adding on to ReallyUnikatni

script.Parent.MouseClick:Connect(function(plr)
plr.StarterGear:ClearAllChildren()
plr.Backpack:ClearAllChildren()
end)

Make a clickdetector and put the script inside.