When the tool is equipped, the following event will run Player.PlayerGui:WaitForChild( “GunGUI”).Bullets.Text = “Bullets: “. Player.PlayerGui:WaitForChild( “GunGUI”).Bullets.Text = “Reloading!” Local fetchBulletsLeft = replicatedstorage:WaitForChild( “FetchBulletsLeft”)įunction findBodyType() - Used to determine whether a player is R6 or R15īodytype = checkBodyType:InvokeServer(tool) - Invoking the Remotefunction to do a check on the server Local checkBodyType = replicatedstorage:WaitForChild( “CheckBodyType”) Local unequipanimation = replicatedstorage:WaitForChild( “UnequipAnimation”) Local shootevent = replicatedstorage:WaitForChild( “ShootEvent”) Local reload2 = replicatedstorage:WaitForChild( “Reload”) Local headshot = replicatedstorage:WaitForChild( “Headshot”) Local equipAnimation = replicatedstorage:WaitForChild( “EquipAnimation”) Local bullets = tool:WaitForChild( “Bullets”) Local gungui = tool:WaitForChild( “GunGUI”) Local replicatedstorage = game:GetService( “ReplicatedStorage”) Local difference = 0 - Difference between position of head and mouse Local bodytype = nil - Nil for now but will check whether player is R6 or R15 Local contextActionService = game:GetService( “ContextActionService”) - Allow us to cater for Mobile players Local reloading = false - Variable to check if we are currently reloading Local sound = tool:WaitForChild( “Gunfire”) Local mouse = player:GetMouse() - Getting the mouse Local player = game:GetService( “Players”).LocalPlayer - Getting the player Local tool = script.Parent - Getting the tool Local Script, which goes inside the tool If game.Workspace:FindFirstChild( “Torso”) then - R6 If game.Workspace:FindFirstChild( “LowerTorso”) then - R15 Local reloadAnim = :LoadAnimation(animation) :Connect( function(player,animation)įor i,v in pairs(game.Workspace:GetChildren()) do Local newAnim = :LoadAnimation(animation) Local humanoid = part.Parent:FindFirstChild( “Humanoid”) ReplicatedStorage.Headshot:FireClient(player) :Connect( function(player,tool,position,part) Local replicatedStorage = game:GetService( “ReplicatedStorage”) Local serverStorage = game:GetService( “ServerStorage”)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |