Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function equip(weapon)
- if char:FindFirstChild(weapon.Name) then
- if currentgun ~= weapon then
- locke = true
- st = require(weapon.Data.Modules.settings)
- currentgun = weapon
- print("Loading "..currentgun.Name)
- frate = st.rate
- auto = st.auto
- switchdelay = true
- delay(0.25,function()
- switchdelay = false
- end)
- if not idle or not fire or not reload then
- idle = char.Humanoid.Animator:LoadAnimation(weapon.Data.Animations.Idle)
- fire = char.Humanoid.Animator:LoadAnimation(weapon.Data.Animations.Fire)
- reload = char.Humanoid.Animator:LoadAnimation(weapon.Data.Animations.Reload)
- lowered = char.Humanoid.Animator:LoadAnimation(weapon.Data.Animations.Lowered)
- if not st.shotgunreload then
- reload.Stopped:Connect(function()
- if currentgun then
- if currentgun.Data.Ammo.Reserve.Value > 0 then
- if currentgun.Data.Ammo.Mag.Value < st.mag then
- local ammotakefromleftover = st.mag - currentgun.Data.Ammo.Mag.Value
- if currentgun.Data.Ammo.Reserve.Value > ammotakefromleftover then
- currentgun.Data.Ammo.Mag.Value = st.mag
- currentgun.Data.Ammo.Reserve.Value = currentgun.Data.Ammo.Reserve.Value - ammotakefromleftover
- else
- currentgun.Data.Ammo.Mag.Value = currentgun.Data.Ammo.Reserve.Value
- currentgun.Data.Ammo.Reserve.Value = 0
- end
- uiupdate()
- end
- end
- rld=false
- end
- end)
- end
- end
- if not weapon.Data.Ammo:FindFirstChild("Done") then
- local th = Instance.new("Folder",weapon.Data.Ammo); th.Name = "Done"
- currentgun.Data.Ammo.Mag.Value = st.mag
- currentgun.Data.Ammo.Reserve.Value = st.rsrv
- end
- uiupdate()
- print(currentgun.Name.." was successfully equipped")
- if currentgun.Data:FindFirstChild("silenced") then
- currentgun.Handle.Suppressor.Highlight.Adornee = nil
- delay(0.1,function()
- currentgun.Handle.Suppressor.Highlight.Adornee = currentgun.Handle.Suppressor
- end)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement