Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Brick changes color after hit by bullet?

Yeah, I want to change a brick color when hit by bulletThis is my script for now...

function onTouched(hit)
	if hit.Parent.Name=="Bullet"
	then script.Parent.BrickColor = BrickColor.new("Really red")
	end
	end
script.Parent.Touched:connect(onTouched)

But it doesnt do anything, Help me.

1 answer

function onTouched(hit)
    if hit.Name=="Bullet"
    then script.Parent.BrickColor = BrickColor.new("Really red")
    end
    end
script.Parent.Touched:connect(onTouched)

The bullet is a part not a model so only but 1 parent in line 2.

9 comments

0

Oops, Didnt saw that

0

I tryed, it did work with other blocks except for the bullet itself

0

wait so you want the bullet to change color when it hits something?

0

I want that the Target will change color after the bullet hits the target

0

what do you mean "I tryed, it did work with other blocks except for the bullet itself"

0

I put the script into the block, Then I touched the block with a other part. But if I shoot it It wont change color. BTW the bullet is in a model called: Ray_Ignore

0

First Ray_Ignore does what it says, it ignores stuff, second the bullet might be travelling so fast it doesn't register, to fix this, make it make bullet holes when it hits something and make the script if name="hole" then ..

0

How do I make those bullet holes. I'm new to scripting an all :P

0

I don't know how to explain it, look it up on youtube.

This discussion is preserved as it was. New answers, comments, and votes are closed.