This script is placed inside a brick, and players are assigned a colour which is in a folder I called Settings, which is placed in the Player, and there's a Brickcolor Value and when this brick is touched, I want the Brick's colour to be the BrickColor Value that the player was assigned, but for some reason this is not working, yet no output.
function onTouched(hit)
local check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local name = hit.Parent.Name
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:FindFirstChild("Settings").Colour
if stats ~= nil then
script.Parent.BrickColor = BrickColor.new(stats.Value)
end
end
end
script.Parent.Touched:connect(onTouched)

1 comment
Thanks also for this