Here's what I have
workspace.Part.playerWhoClicked = script.Parent.Parent.BrickColor.BrickColor.new("Bright red")
and also it comes up with no error, please help I would appreciate it.
Here's what I have
workspace.Part.playerWhoClicked = script.Parent.Parent.BrickColor.BrickColor.new("Bright red")
and also it comes up with no error, please help I would appreciate it.
Not sure what your script suppose to do, the syntax for your script is wrong, i think you should go back to basic
But this is what you need if you want to detect clicks on a brick https://developer.roblox.com/en-us/api-reference/class/ClickDetector
-1 for "the syntax for your script is wrong, i think you should go back to basic". This syntax is perfectly valid. It's the implementation that is wrong.
thanks
@programmerHere Oh just fudge off, are you simon cowell of anwers or something? Get something better to do than going around trying to find faults in others e.g actually helping people., Its not like my solution to his problem is wrong, you don't just use BrickColor.new on a property,
It's not syntax issue lol, look up the definition of syntax. If nobody does quality control who will? No wonder you have -9 votes
This could be a simple fix.
game.Workspace.Part.ClickDetector.MouseClick:Connect(function()
game.Workspace.Part.BrickColor = BrickColor.new("Bright red)
end)
go ahead and copy paste it.
I don't really know what the code is that you posted, but let's walk through this as if you were new to coding. If you wanted to detect a click on a model/part, then you need to use a "ClickDetector", so if you do not have it, then you insert one into the part.
*Steps: *
local ClickDetector = script.Parent:WaitForChild("ClickDetector") -- Index the ClickDetector
ClickDetector.MouseClick:Connect(function() -- Listen for a click
script.Parent.BrickColor = BrickColor.random() -- Make the part a random color
end)
Roblox has a nice guide on this already. Here. https://developer.roblox.com/en-us/articles/introduction-to-input Just change the variables, etc. and the brick color at the bottom, and it should work.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
What is "playerWhoClicked"? If it's a ClickDetector, you should wrap the code in a "ClickDetector.MouseClick:Connect(function))" event, don't forget to end the function with "end)"