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:
1 | game.Workspace.Windows.Touched:Connect( function (Windows) |
2 | Windows = script.Parent |
3 |
4 | Windows.Position = Vector 3. new(- 38 , 0.5 , 57 ) |
5 | end ) |
but, how do I make it so it must be touched by a bullet to break?
Something like this should work if the bullet is called Bullet:
1 | game.Workspace.Windows.Touched:Connect( function (partThatTouched) |
2 | if partThatTouched.Name = = "Bullet" then |
3 | Windows.CFrame = CFrame.new(- 38 , 0.5 , 57 ) |
4 | end |
5 | end ) |