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

Trying to Make Windows Only Breakable By Certian Object?

I'm trying to make breakable windows, partly for my game, partly for a personal scripting challenge. My only problem is that I want to make it so that "Windows" must be touched by a bullet to move. Here's the script I have so far:

game.Workspace.Windows.Touched:Connect(function(Windows)
	Windows = script.Parent

Windows.Position = Vector3.new(-38, 0.5, 57)
end)

but, how do I make it so it must be touched by a bullet to break?

1 answer

✓ Accepted answer

Something like this should work if the bullet is called Bullet:

game.Workspace.Windows.Touched:Connect(function(partThatTouched)
	if partThatTouched.Name == "Bullet" then
		Windows.CFrame = CFrame.new(-38, 0.5, 57)
	end
end)

1 comment

0

Or if the window is anchored, just unanchor it.

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