Advertisement
Guest User

properties

a guest
Jun 6th, 2025
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. -- [[
  2. -- What is this file? -You mess around with this file mate. Above the "German"
  3. -- part.
  4. -- ]]
  5.  
  6. ----- WEAPON SETTINGS ----- (v1)
  7. --- Basic properties ---
  8. local name = "testtest"
  9. local desc = "yup what else do you want huh"
  10.  
  11. --- Technical ---
  12. -- Bullet --
  13. local barrelNr = 1
  14. local magCap = 17
  15. local magReserve = 5
  16. local muzzleVelocity = 915
  17. local damage = 10
  18. local damageHeadshotMultiplier = 1.2
  19. local damageOtherMultiplier = 0.8
  20.  
  21. local bulletType = "9x18mm Parabellum" -- for a mag/bullet dictionary (incl. velocity, damage, etc.) to be implemented later
  22. local magType = "Standard (Handgun, 9x18mm)"
  23. -- Damage --
  24.  
  25.  
  26.  
  27.  
  28. gunType = "semi"
  29.  
  30. -- BORING BORING GERMAN BORING
  31.  
  32. local variablesFile = script.Parent.Properties
  33. local barrelNrValue = variablesFile.barrelNrValue
  34. local magCapValue = variablesFile.magCapValue
  35. local magReserveValue = variablesFile.magReserveValue
  36. local damageValue = variablesFile.damageValue
  37. local damageHeadshotMultiplierValue = variablesFile.damageHeadshotMultiplierValue
  38. local damageOtherMultiplierValue = variablesFile.damageOtherMultiplierValue
  39. local bulletTypeValue = variablesFile.bulletTypeValue
  40. local magTypeValue = variablesFile.magTypeValue
  41.  
  42. barrelNrValue.Value = barrelNr
  43. magCapValue.Value = magCap
  44. magReserveValue.Value = magReserve
  45. damageValue.Value = damage
  46. damageHeadshotMultiplierValue.Value = damageHeadshotMultiplier
  47. damageOtherMultiplierValue.Value = damageOtherMultiplier
  48. bulletTypeValue.Value = bulletType
  49. magTypeValue.Value = magType
  50.  
  51.  
  52. local tool = script.Parent
  53. local player = game:GetService("Players").LocalPlayer
  54. local mouse = player:GetMouse()
  55. local fireEvent = tool:WaitForChild("fireEvent")
  56. local runService = game:GetService("RunService")
  57. local userInputService = game:GetService("UserInputService")
  58.  
  59.  
  60. if gunType == "semi" then
  61. tool.Activated:Connect(function()
  62. local mousePosition = mouse.Hit.Position
  63.  
  64. fireEvent:fireServer(mousePosition)
  65. end)
  66. elseif gunType == "auto" then
  67. runService.Stepped:Connect(function()
  68. if userInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
  69. local mousePosition = mouse.Hit.Position
  70.  
  71. fireEvent:fireServer(mousePosition)
  72. end
  73. end)
  74. end
  75.  
  76. print(damageValue.Value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement