I want to make a remote event that whenever the mouse pressed on any part the color of it gets randomized.
the problem is that the parts brickcolor always goes to “255, 255, 255”
local replicatedstorage = game:GetService("ReplicatedStorage")
local remote = replicatedstorage.Colors
local color1 = math.random(0, 255)
local color2 = math.random(0, 255)
local color3 = math.random(0, 255)
remote.OnServerEvent:Connect(function(player, hit)
print(color1)
print(color2)
print(color3)
local mouse = player:GetMouse()
local character = player.Character
hit.BrickColor = BrickColor.new(color1, color2, color3)
player.PlayerGui.ScreenGui.Frame.TextLabel.Text = ""..color1..","..color2..","..color3..""
end)
This is the script, for some reason it does not work.
Everything except this part
hit.BrickColor = BrickColor.new(color1, color2, color3)
works