(SOLVED) Issue with whiteboard gui

Im working on a windows xp game and im having a gui white board but I cant get it to work on changing the colour

I can send the explorer if needed
code:

local frame = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse()
local ClearButton = script.Parent.ClearButton

local x
local y

local pressed = false

mouse.Button1Down:Connect(function()
pressed = true
end)

mouse.Button1Up:Connect(function()
pressed = false
end)

game:GetService(“RunService”).RenderStepped:Connect(function()
x = mouse.X
y = mouse.Y
if pressed == true then
local dot = Instance.new(“Frame”)
dot.Name = “Dot”
dot.Parent = frame
dot.BackgroundColor3 = Color3.new(0,0,0)
dot.Size = UDim2.new(0, 6, 0, 6)
dot.Position = UDim2.new(0, x - frame.AbsolutePosition.X, 0, y - frame.AbsolutePosition.Y)
end
end)

ClearButton.MouseButton1Click:Connect(function()
for i, q in pairs(frame:GetChildren()) do
if q.Name == “Dot” then
q:Destroy()
end
end
end)
local color = Color3.fromRGB(255, 0, 0)
(dot.BackgroundColor3 = color)
RedButton.MouseButton1Click:Connect(function)
color = Color3.fromRGB(0, 0, 0)
end)

1 Like

What Colour are you looking for? Black white green blue Rainbow? And yes im in Canada so don’t make fun of me for spelling “Colour” Instead of “Color”

1 Like

I am looking for red i can see why you ask because of 255,0,0 then the 0,0,0

1 Like

Can I use you’re script rlly quick in studio to try to figure it out?

1 Like

Yeah its fine i expect that it does work without the colour part but it dont with the colour part

1 Like

Ok be right back, I hope this works

2 Likes

Ok try switching these 2 around


This didnt work if this helps here is the output

Players.3DRobloxGameDev.PlayerGui.Options.Startup.frame.LocalScript:39: Ambiguous syntax: this looks like an argument list for a function call, but could also be a start of new statement; use ‘;’ to separate statements

Im pretty new well not pretty new to scripting I’ve figured out how to script VIP Chat tags and stuff like this

But I’ve never seen anything like this. I might not be able to help this.

why adding a () in between those?

A error i must of made during doing it i just removed them it sorted the issue of some of the red underline in the code

local frame = script.Parent local mouse = game.Players.LocalPlayer:GetMouse() local ClearButton = script.Parent.ClearButton

local x local y local pressed = false mouse.Button1Down:Connect(function() pressed = true end)
mouse.Button1Up:Connect(function() pressed = false end)

game:GetService("RunService").RenderStepped:Connect(function() x = mouse.X y = mouse.Y if pressed == true then local dot = Instance.new("Frame") dot.Name = "Dot" dot.Parent = frame dot.BackgroundColor3 = Color3.new(0,0,0) dot.Size = UDim2.new(0, 6, 0, 6) dot.Position = UDim2.new(0, x - frame.AbsolutePosition.X, 0, y - frame.AbsolutePosition.Y) end end)
ClearButton.MouseButton1Click:Connect(function() for i, q in pairs(frame:GetChildren()) do if q.Name == "Dot" then q:Destroy() end end end) color = Color3.fromRGB(0, 0, 0) dot.BackgroundColor3 = color RedButton.MouseButton1Click:Connect(function) color = Color3.fromRGB(0, 0, 0) local color = Color3.fromRGB(255, 0, 0) end)

1 Like

I guess I see the issue.

Are you referencing “dot” in both of your functions (the run service and the mouse button click)?

because it seems like you reference it in the first function and not the the other and the script don’t know what “dot” is

syntax errors
you don’t need to bracket dot.BackgroundColor3 = color otherwise it may break
2, last function loop opening is lacking an opening bracket after function [ (function() ]
edit: my bad issue 1 is already fixed

2 Likes

I used this off a youtube tutorial im not a strong scripter but yes i have mentioned dot in the colour part to

also, is the RedButton variable predefined?

“RedButton.MouseButton1Click:Connect(function)]”

Ooh that maybe the issue i dont think it is

RedButton.MouseButton1Click:Connect(function()******

red underline in redbutton and dot