How can I make my brick color change when i use my kill brick? basically if i get killed by the kill brick i want my objects color to change to what ever could some one please show me how?
COMMUNITY QUESTION
How can I make my brick coled by the kilever could some one please show me how?
1 answer
I'll list some documentation for this so you can get a look at how this works:
https://create.roblox.com/docs/reference/engine/classes/BasePart#Touched - touch event https://developer.roblox.com/en-us/articles/BrickColor-Codes/ - brick color
--
script.Parent.Touched:Connect(function(touched) -- when the part is touched, as well as it gets what has touched it with "touched"
if touched.Parent:FindFirstChild("Humanoid") then -- if what is touching the part is a humanoid
touched.Parent.Humanoid.Health = touched.Parent.Humanoid.Health - 25 -- set 25 to whatever value you want
script.Parent.Color = Color3.new(0.101961, 1, 0) -- color you want it to change to
end
end)
If this helps if you could mark my post as the solution that would be appreciated.
This discussion is preserved as it was. New answers, comments, and votes are closed.
