Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [[
- -- What is this file? -You mess around with this file mate. Above the "German"
- -- part.
- -- ]]
- ----- WEAPON SETTINGS ----- (v1)
- --- Basic properties ---
- local name = "testtest"
- local desc = "yup what else do you want huh"
- --- Technical ---
- -- Bullet --
- local barrelNr = 1
- local magCap = 17
- local magReserve = 5
- local muzzleVelocity = 915
- local damage = 10
- local damageHeadshotMultiplier = 1.2
- local damageOtherMultiplier = 0.8
- local bulletType = "9x18mm Parabellum" -- for a mag/bullet dictionary (incl. velocity, damage, etc.) to be implemented later
- local magType = "Standard (Handgun, 9x18mm)"
- -- Damage --
- gunType = "semi"
- -- BORING BORING GERMAN BORING
- local variablesFile = script.Parent.Properties
- local barrelNrValue = variablesFile.barrelNrValue
- local magCapValue = variablesFile.magCapValue
- local magReserveValue = variablesFile.magReserveValue
- local damageValue = variablesFile.damageValue
- local damageHeadshotMultiplierValue = variablesFile.damageHeadshotMultiplierValue
- local damageOtherMultiplierValue = variablesFile.damageOtherMultiplierValue
- local bulletTypeValue = variablesFile.bulletTypeValue
- local magTypeValue = variablesFile.magTypeValue
- barrelNrValue.Value = barrelNr
- magCapValue.Value = magCap
- magReserveValue.Value = magReserve
- damageValue.Value = damage
- damageHeadshotMultiplierValue.Value = damageHeadshotMultiplier
- damageOtherMultiplierValue.Value = damageOtherMultiplier
- bulletTypeValue.Value = bulletType
- magTypeValue.Value = magType
- local tool = script.Parent
- local player = game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- local fireEvent = tool:WaitForChild("fireEvent")
- local runService = game:GetService("RunService")
- local userInputService = game:GetService("UserInputService")
- if gunType == "semi" then
- tool.Activated:Connect(function()
- local mousePosition = mouse.Hit.Position
- fireEvent:fireServer(mousePosition)
- end)
- elseif gunType == "auto" then
- runService.Stepped:Connect(function()
- if userInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
- local mousePosition = mouse.Hit.Position
- fireEvent:fireServer(mousePosition)
- end
- end)
- end
- print(damageValue.Value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement