micopiri6
(what)
December 31, 2021, 5:44pm
#1
Im trying to change a part’s color but its not working
game.ReplicatedStorage.SpawnPart.OnServerEvent:Connect(function(Player, Mouse)
local part = Instance.new("Part", workspace)
part.Anchored = true
part.Position = Mouse.p
part.Size = Vector3.new(5,5,5)
part.Touched:Connect(function(hit)
if hit.Parent:IsA("Part") then
part.Color = hit.Parent.Color
end
end)
game:GetService("Debris"):AddItem(part, 5)
end)
1 Like
NyrionDev
(Nyrion)
December 31, 2021, 5:49pm
#2
Perhaps you meant hit:IsA("BasePart")
(and hit.Color
) or hit.Parent:IsA("BasePart")
?
Also keep in mind if both the part and the hit
are anchored, .Touched
wont fire.
Sorry if this is very bad but maybe do
Game.Workspace.(Part name you want to use).color.(color)
Im sorry if this does not work I learned this from a tutorial
Or replace color with the name BrickColor
micopiri6
(what)
December 31, 2021, 5:55pm
#5
Brickcolors and color3s are a different thing. but thanks for help
micopiri6
(what)
December 31, 2021, 5:55pm
#6
hit.parent is the part i want to get color of