I want it where when a player clicks without a tool would shoot out a ball from the torso. And it is in a LocalScript in StarterPack
1 | game.Players.LocalPlayer.MouseButton 1 Click:connect( function () |
2 | Brick = Instance.new( "Part" ) |
3 | Brick.Shape = "Ball" |
4 | Brick.Size = Vector 3. new( 3 , 3 , 3 ) |
5 | Brick.BrickColor = BrickColor.Random( 3 , 5 , 9 , 1 ) |
6 | end ) |
Thank you.
If you're using a LocalScript you can do this to detect when a player has pressed the left mouse button down:
01 | local player = Game.Players.LocalPlayer |
02 | local mouse = player:GetMouse() |
03 |
04 | mouse.Button 1 Down:connect( function () |
05 | Brick = Instance.new( "Part" ,Workspace) |
06 | Brick.Position = player.Character:WaitForChild( "Torso" ).Position |
07 | Brick.Shape = "Ball" |
08 | Brick.Size = Vector 3. new( 3 , 3 , 3 ) |
09 | Brick.BrickColor = BrickColor.Random( 3 , 5 , 9 , 1 ) |
10 | end ) |