Advertisement
Er1x_Official

raycast gun local script

Oct 31st, 2022 (edited)
2,444
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local RunService:RunService = game:GetService("RunService")
  2. local Players:Players = game:GetService("Players")
  3. local Player = Players.LocalPlayer
  4. local Mouse = Player:GetMouse()
  5.  
  6. local Tool:Tool = script.Parent
  7. local RemoteEvent:RemoteEvent = script.Parent.RemoteEvent
  8. local Holdable,Holding = true,false -- set holdable to true if you want the player to be able to hold fire like a automatic weapon
  9.  
  10. function Send() -- send mouse position to server
  11.     RemoteEvent:FireServer({Position = Mouse.Hit.Position})
  12. end
  13.  
  14. Tool.Activated:Connect(function()
  15.     Holding = true
  16.     if Holdable then
  17.         local Run
  18.         Run = RunService.Heartbeat:Connect(function()
  19.             if not Holding then
  20.                 Run:Disconnect()
  21.             end
  22.            
  23.             Send()
  24.         end)
  25.     else
  26.         Send()
  27.     end
  28. end)
  29.  
  30. Tool.Deactivated:Connect(function()
  31.     Holding = false
  32. end)
  33.  
  34. Tool.Unequipped:Connect(function()
  35.     Holding = false
  36. end)
Advertisement
Comments
  • mozmoz1
    1 year
    # text 1.17 KB | 0 0
    1. Autowin888 [ออโต้วิน888] การเดิมพันกีฬาออนไลน์มิติใหม่ของการเดิมพันกีฬา ในอดีตคนจำนวนมากใช้วิธีการเดิมพันโดยติดต่อกับดีลเลอร์หรือโต๊ะโดยตรง ซึ่งราคาต่อรองต่าง ๆ ตารางจะถูกปรับแต่ง โต๊ะตัวใหญ่จะมีเอเจนซี่เล็ก ๆ และจะมีลูกให้เดินเพื่อรับและส่งเดิมพันให้กับลูกค้าแต่ละคน แต่ตอนนี้ทุกอย่างเปลี่ยนไปเพราะเรามีเว็บไซต์การพนันกีฬาออนไลน์นำเสนอการพัฒนาคุณสมบัติและระบบอย่างต่อเนื่อง
    2.  
    3. <a href="https://autowin888.com/">autowin888</a>
    4. [url=https://autowin888.com]autowin888[/url]
    5. https://autowin888.com/
  • mozmoz1
    1 year
    # text 0.02 KB | 0 0
    1. #https://autowin888.com/
Add Comment
Please, Sign In to add comment
Advertisement