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

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

Asked by 5 years ago
Edited 5 years ago

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.

0
You might want to elaborate on your question a bit more to help people answer your question. EpicMetatableMoment 1444 — 5y
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! EpicMetatableMoment 1444 — 5y
0
Pretty sure you have to use a remoteEvent and make it Client-Sided. TheOnlySmarts 233 — 5y
0
It's inside a localscript, is that not good enough? LordBlueSky 10 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I've fixed it.

The problem was the part variable.

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

It's fixed now.

Ad

Answer this question