My main goal is to have a brick change color whenever I click it. I don't know why, but my script or Roblox doesn't seem to work.
I am using a click detector which seems to work because whenever I hover over the brick a hand appears. I trying to do Alvin blox project here https://www.youtube.com/watch?v=yJglWQM0h5A.
here is my first script, I believe it is identical to the one in the video. It's a local script and is located under starterGui.
local clickdetector = game.Workspace.Part.ClickDetector clickdetector.MouseClick:Connect(function() game.Workspace.MyClickDetectorEvent.FireServer() end)
MyClickDetectorEvent is what the remote event is called
This next script is located under the RemoteEvent. here it is game.Workspace.MyClickDetectorEvent.OnServerEvent:Connect(function() script.Parent.Parent.Part.BrickColor = BrickColor.Random()
end)
if anyone knows of potential problems please let me know. thanks

4 comments
Do any errors appear in the output?
sorry never mind, there was an error. it said this 20:50:46.399 - Expected ':' not '.' calling member function FireServer.
solved it thanks so much benbebop. I didn't even realize that I could look in the output. I am a complete noob
Code Block.