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

I want to change a bricks colour when you click a colour on a gui, but it fails to work?

So I am testing some stuff, and I want a part of my game to be where you have a part where you can change its colour with this gui, but I am having problems.

Here is the script:

local gui = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Green
local frame = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
local part = game.Workspace.Part4

gui.MouseButton1Click:Connect(function()
	part.BrickColor = BrickColor.new("Lime green")
end)

Help is appreciated.

4 comments

0

You might want to elaborate on your question a bit more to help people answer your question.

0

By elaborate on your question I meant extend more on this "but I am having problems." We can't help much if we don't know what those problems are!

0

Pretty sure you have to use a remoteEvent and make it Client-Sided.

0

It's inside a localscript, is that not good enough?

1 answer

I've fixed it.

The problem was the part variable.

game.Workspace.Part4, the Part4 was the wrong part.

It's fixed now.

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