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

How to make a On-Clicked Part?

Asked by 9 years ago

Hello, Like I said in my previous questions, I am building something. I just want to know how to make an on-Clicked Part, If you do answer. Thank you, If you sneezed "Bless You".

0
There you go so please upvote and accept answer please. duckyo01 120 — 9y

2 answers

Log in to vote
1
Answered by
duckyo01 120
9 years ago

Ok well it would be like

function onClicked(playerWhoClicked)
    script.Parent.BrickColor = BrickColor.Random()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

0
good for answering, but you should explain how it was used, otherwise he wont be able to rly learn how to use it in the future nicros 165 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

To make an onClicked part, you would need two things, one, click detector is inserted into the part that you want to click.

Second, if you want to click sonething, it needs a function.

For example,

function onClicked()

("Now type anything you want the function to execute)

game.Workspace.Part.Transparency = 0.6

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
-This would be calling the function, so it can activate.

-Whatever you put between the lines of the function, is what the script will execute.
0
... come on I just said that :/ duckyo01 120 — 9y
0
He explained it though. Upvoted PreciseLogic 271 — 9y

Answer this question