Im making a whiteboard Gui and have an issue with making the dot bigger in size so when you press once it sizes it by 1 or so bigger
The issue is i cant find something that i want or without it breaking my code
Code:
--Service local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse()
--Gui local frame = script.Parent local ClearButton = script.Parent:WaitForChild("ClearButton")
--Value local dotColor = Color3.new(0,0,0) local pressed = false local x,y,dot
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 dot = Instance.new("Frame") dot.Name = "Dot" dot.BorderSizePixel = 0 dot.Parent = frame dot.BackgroundColor3 = dotColor 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)
for number,buttons in pairs(frame:GetChildren()) do --get all things if buttons:IsA("TextButton") and buttons:GetAttribute("dotColor") then -- filter buttons with attribute named dotcolor buttons.MouseButton1Up:Connect(function() dotColor = buttons:GetAttribute("dotColor") --change dotcolor to color in attribute end) end end
MoreSize.MouseButton1Click:Connect(function() for i, q in pairs(frame:GetChildren()) do dot.Name = "Dot" dot.BorderSizePixel = 0 dot.Parent = frame dot.BackgroundColor3 = dotColor dot.Size = UDim2.new(0, 9, 0, 6) dot.Position = UDim2.new(0, x - frame.AbsolutePosition.X, 0, y - frame.AbsolutePosition.Y) end)
Im not the best coder im slowly learning and tried for a bit