![]() For weapons with FireMode of Automatic, this is also the time between shots while pressing the fire button or holding click. Note that ammo is unlimited and this does not specify how much ammo a player is carrying.Ĭhoose from either Semiautomatic (one shot per click/tap), Automatic (continuous fire), or Burst (burst of shots equal to NumBurstShots on each click/tap). Plrgui:WaitForChild("HotBarGUI").Number of shots in each "ammo clip" before player must reload. :Connect(function()Ĭlient.Character:WaitForChild("Humanoid").WalkSpeed = 17.5 ![]() Text.Text = (ammo)." / ".tostring(maxAmmo)ĬAS:BindAction("FireWeapon", GunHandler, true, 1, Enum.Ke圜ode.ButtonR2)ĬAS:BindAction("Reload", GunHandler, true, Enum.Ke圜ode.R, Enum.Ke圜ode.ButtonX)ĬAS:BindAction("WeaponZoom", GunHandler, true, 2, Enum.Ke圜ode.ButtonL2) lay(CoolDown, function() gunCooldown = false end)Įlseif ActionName = "FireWeapon" and BoolValue.Value and (table.find(FireTypes, inputObject.UserInputType) or table.find(FireTypes, inputObject.Ke圜ode)) and not reloading and not gunCooldown then If humanoid.Health 0 and not gunCooldown then Local humanoid = part.Parent:FindFirstChild("Humanoid") or :FindFirstChild("Humanoid") Local PlayerName = Instance.new("StringValue") Local bullet_clone = ServerStorage.Bullet:Clone()īullet_clone.Size = Vector3.new(0.1, 0.1, distance)īullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2) Local distance = (origin - intersection).Magnitude Local intersection = result and result.Position or origin + direction Local result = Workspace:Raycast(origin, direction) Local direction = (position - origin).Unit*300 ![]() Remote.OnServerEvent:Connect(function(player, position) Local ServerStorage = game:GetService("ServerStorage") Local Workspace = game:GetService("Workspace") Local remote = tool:WaitForChild("OnShoot") Local shoot_part = tool:WaitForChild("Handle") Server Script: local tool = script.Parent My gun will not make a bullet to where the mouse if pointing (sometimes), but let me know what you guys think. ![]() Hey developers, I made a custom gun script, and I want to check what you guys think. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |