myPart = Instance.new("Part",workspace) myPart.CFrame = CFrame.new(10, 0, 10)
function onTouch(myPart) local Char = myPart.Parent local Human = Char:FindFirstChild("Humanoid") if Human then local plyr = game.Workspace.Name local explosion = Instance.new("Explosion") explosion.Position = myPart.Position game.Workspace.name.BrickColor = BrickColor.Red end
end
myPart.Touched:Connect(onTouch)
I was using this script to generate an explosion and paint the torso of whoever touched it red, but I don't know how to do that. No matter what I try I can't change the value of the humanoid that touched the brick, can I have some help?

2 comments
Thanks, also sorry for the code block thing, never touched this site lol. What I originally intended was to practice with certain properties, and I wanted to be able to play with affecting a humanoid whenever they touched something, and your adjustments did answer my original question, thanks!
It's good, let me know if you ever need help again!