How to make a GUN in ROBLOX STUDIO (2024)

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

ความคิดเห็น • 119

  • @Scrip_tix
    @Scrip_tix  10 หลายเดือนก่อน +18

    Server code:
    local Tool = script.Parent
    local Handle = Tool.Handle
    local MouseEvent = Tool.MouseEvent
    local CanFire = true
    local MIN_BULLET_SPREAD_ANGLE = 0
    local MAX_BULLET_SPREAD_ANGLE = 0
    local FIRE_DELAY = 0.1
    local BULLETS_PER_SHOT = 1
    local RNG = Random.new()
    local TAU = math.pi * 2
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    function Fire(endPoint, startPos)
    if Tool.Parent:IsA("Backpack") then return end
    local direction = (endPoint - Handle.Front.Position).Unit
    local directionalCF = CFrame.new(Vector3.new(), direction)
    local newDirection = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true
    local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
    if raycastResult then
    if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
    CanFire = true
    end)

    • @Lucky_Rabbit12
      @Lucky_Rabbit12 10 หลายเดือนก่อน

      what about the script??

    • @Narbil
      @Narbil 9 หลายเดือนก่อน

      can I give him a copy of the script so I don't have to write anymore?

    • @PIXL-Studio
      @PIXL-Studio 7 หลายเดือนก่อน

      BRO I WROTE EVERY SINGLE LINE OF CODE BY PAUSING AND STUFF AND NOW I SEE THIS THE #######

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน

      local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local Tween Service = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endpos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน

      Any problems with this code?

  • @YoureTripping
    @YoureTripping 10 หลายเดือนก่อน +4

    contgrats on hitting 1k i found you a couple days ago btw

  • @GamerAnneplays26
    @GamerAnneplays26 10 หลายเดือนก่อน +2

    Congratulations on 1k!

    • @Scrip_tix
      @Scrip_tix  10 หลายเดือนก่อน +1

      Thank you so much 😀

  • @galaxysedge-wv9de
    @galaxysedge-wv9de 10 หลายเดือนก่อน +1

    i am so happy to see this video becasue i was just about to code a gun!

  • @Sgamer1Yt
    @Sgamer1Yt 8 หลายเดือนก่อน +7

    YO IT WORKS TYSM And how can I add sound effects when the gun shoots?
    Here's the code For everyone just trying to help :]
    LocalScript in The gun :
    local tool = script.Parent
    local handle = tool.Handle
    local Players = game:GetService("Players")
    local MouseEvent = tool:WaitForChild("MouseEvent")
    local Mouse = Players.LocalPlayer:GetMouse()
    local ExpectingInput = false
    local IsMouseDown = false
    function OnEquipped(playerMouse)
    Mouse = playerMouse
    ExpectingInput = true
    IsMouseDown = false
    end
    function OnUnequipped()
    ExpectingInput = false
    IsMouseDown = false
    end
    function Activated()
    IsMouseDown = true
    end
    function OnDeactivated()
    IsMouseDown = false
    end
    tool.Equipped:Connect(OnEquipped)
    tool.Unequipped:Connect(OnUnequipped)
    tool.Activated:Connect(Activated)
    tool.Deactivated:Connect(OnDeactivated)
    game:GetService("RunService").Stepped:Connect(function()
    if IsMouseDown == true then
    MouseEvent:FireServer(Mouse.Hit.Position, handle.Front.Position)
    end
    end)
    LocalScript in the starterplayerscript :
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    local TweenService = game:GetService("TweenService")
    local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
    local RunService = game:GetService("RunService")
    local DebrisService = game:GetService("Debris")
    local function visualize(startPos, endPos, distance, color)
    local bullet = ShotPart:Clone()
    bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
    bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
    bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
    bullet.Position = startPos
    local goal = {}
    goal.Position = endPos
    local tweenInfo = TweenInfo.new(distance/500)
    local tween = TweenService:Create(bullet, tweenInfo, goal)
    DebrisService:AddItem(bullet, distance/500)
    bullet.Parent = game.Workspace
    RunService.RenderStepped:Wait()
    RunService.RenderStepped:Wait()
    tween:Play()
    end
    VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @isragdd
      @isragdd หลายเดือนก่อน

      TYSM MANNN

    • @FREEDOM-akamefreedom
      @FREEDOM-akamefreedom หลายเดือนก่อน

      ur the best man thanks SO MUCH

    • @supreme_wafflez9497
      @supreme_wafflez9497 หลายเดือนก่อน

      tysm to add a sound simply [add a sound to the gun] and [Get its Directory] then [Add it to the script]
      local sound = tool.Sound ,Sound)
      Play:Sound()

  • @mtlikelyausten5564
    @mtlikelyausten5564 7 หลายเดือนก่อน +3

    Hello, I made the gun successfully the first time (making a zombie game, I made some modifications but other than that everything is working perfectly), but I tried making a pistol now using the same code and parts, and it won't work! I have made sure to make the proper modifications to the scripts to reference the new parts inside the pistol, and I am returning 0 errors in the output. So then i tried just simply duplicating the Rifle I made, and it didn't work! exact same parts and code, no modifications, and it didn't work!!! It seems the way the code is done you can only have one of these guns??? I have tried to make new remote events and a new bullet script to listen for the new remote event to see if this was the problem, and nothing. Another thing I tried was putting "print(print something here)" after lines to make sure they ran, and it when I put a print after my local script fires the event, it prints showing that the code worked, but then the server script never actually hears the event and never runs at all!!! I am at a lost, I will continue to try to fix this and will reply to my own comment if I figure it out myself before a response. Please try to get back to me because this game is looking really good currently and I don't want this to waste too much of my limited time. Thank you so much for the video, and thank you for any potential response!

    • @Scrip_tix
      @Scrip_tix  7 หลายเดือนก่อน

      Interesting. Can you verify that there is a part called 'Front' inside your pistol and that it is positioned where the bullets should come out of and that it is welded to the rest of the gun?

    • @mtlikelyausten5564
      @mtlikelyausten5564 7 หลายเดือนก่อน

      @@Scrip_tix Yeah, there is a part called front, but I've made a new discovery, if I duplicate the assault rifle that is already working, and put it in the starter pack, it works, but if I don't modify a single thing, but instead put the gun in replicated storage, and have a script duplicate the gun and give you the gun, then it doesn't work.

    • @mtlikelyausten5564
      @mtlikelyausten5564 7 หลายเดือนก่อน

      So my idea is, that I am trying to make a pistol as your starting weapon, I got rid of the pistol bc it wasn't working and I am trying to test potential problems using a duplicate of the rifle that I made using this video that actually works. When I put the working rifle in replicated storage, and then once you click play on a gui, duplicate the gun twice and put one in starter gear and one in the players backpack, it doesn't work. It gives you the gun, you can hold it but it wont shoot and won't deal damage. The duplicate of the gun works perfectly fine if I place it in the starter pack though, which might be something to test out, I will update soon if I can find a compromise.

    • @mtlikelyausten5564
      @mtlikelyausten5564 7 หลายเดือนก่อน

      Hey! I figured out the issue! Thank you so much for taking your time to respond to me for absolutely no personal gain, even though I solved it myself, it shows you care a lot about your viewers. I noticed that when I play tested in the current client, that I couldn't see the gun and then remembered that I duplicated the gun and put the gun in starter gear and the starter pack through a local script. Now I put a remote event in and used a regular script, and now it works perfectly!! Thank you for responding and if anyone else somehow has a similar problem, yk what to tell them.

    • @Scrip_tix
      @Scrip_tix  7 หลายเดือนก่อน

      You're welcome!

  • @TheShadow7771
    @TheShadow7771 หลายเดือนก่อน

    For some reason when I equip the gun my character flips sideways onto the ground to hold the tool's grip. Would you happen to know how to fix this?

    • @AzureTheKnightOfTheSwords
      @AzureTheKnightOfTheSwords หลายเดือนก่อน

      is your tool anchored? if yes,then unanchor it,it's mostly caused by the enforcement to the gravity that the game suggests,meaning if you set your tool anchored,the rotation and position of the tool will be kept,leading you to have this problem

  • @EpicityOfEpicness
    @EpicityOfEpicness 7 หลายเดือนก่อน +1

    The gun works but I can’t see the bullets, there’s an error in Local Script in Starterplayerscripts about line 10 that says “ColorSequence.new(): table expected.” What does it mean?

    • @Scrip_tix
      @Scrip_tix  7 หลายเดือนก่อน +1

      Can you show me the code in the localscript?

    • @EpicityOfEpicness
      @EpicityOfEpicness 7 หลายเดือนก่อน

      @@Scrip_tix local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local TweenService = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endPos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)
      btw now there is another error in the local script of my gun "Handle us not a valid member of Tool "Players.(my absolutely embarrassing user here).Backpack.Pistol" so heres the script for that
      local Tool = script.Parent
      local Handle = Tool.Handle
      local Players = game:GetService("Players")
      local MouseEvent = Tool:WaitForChild("MouseEvent")
      local Mouse = Players.LocalPlayer:GetMouse()
      local ExpectingInput = false
      local IsMouseDown = false
      function OnEquipped(playerMouse)
      Mouse = playerMouse
      ExpectingInput = true
      IsMouseDown = false
      end
      function OnUnequipped()
      ExpectingInput = false
      IsMouseDown = false
      end
      function OnActivated()
      IsMouseDown = true
      end
      function OnDeactivated()
      IsMouseDown = false
      end
      Tool.Equipped:Connect(OnEquipped)
      Tool.Unequipped:Connect(OnUnequipped)
      Tool.Activated:Connect(OnActivated)
      Tool.Deactivated:Connect(OnDeactivated)

      game:GetService("RunService").Stepped:Connect(function()
      if IsMouseDown == true then
      MouseEvent:FireServer(Mouse.Hit.Position, Handle.Front.Position)
      end
      end)

    • @EpicityOfEpicness
      @EpicityOfEpicness 7 หลายเดือนก่อน +1

      @@Scrip_tix the problem isnt showing up anymore for some reason but here's the code
      local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local TweenService = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endPos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)
      now, a new problem is showing up, "Handle is not a valid member of Tool "Players.(myuser).Backpack.Pistol" - Client - LocalScript:2 (in the gun) so heres the other local script
      local Tool = script.Parent
      local Handle = Tool.Handle
      local Players = game:GetService("Players")
      local MouseEvent = Tool:WaitForChild("MouseEvent")
      local Mouse = Players.LocalPlayer:GetMouse()
      local ExpectingInput = false
      local IsMouseDown = false
      function OnEquipped(playerMouse)
      Mouse = playerMouse
      ExpectingInput = true
      IsMouseDown = false
      end
      function OnUnequipped()
      ExpectingInput = false
      IsMouseDown = false
      end
      function OnActivated()
      IsMouseDown = true
      end
      function OnDeactivated()
      IsMouseDown = false
      end
      Tool.Equipped:Connect(OnEquipped)
      Tool.Unequipped:Connect(OnUnequipped)
      Tool.Activated:Connect(OnActivated)
      Tool.Deactivated:Connect(OnDeactivated)

      game:GetService("RunService").Stepped:Connect(function()
      if IsMouseDown == true then
      MouseEvent:FireServer(Mouse.Hit.Position, Handle.Front.Position)
      end
      end)

    • @EpicityOfEpicness
      @EpicityOfEpicness 7 หลายเดือนก่อน

      @@Scrip_tix The problem changed now, it's "Handle is not a valid member of Tool "Player.DxrkShadowVibez.Backpack.Pistol" so heres the local script for that says its line 2 btw
      local Tool = script.Parent
      local Handle = Tool.Handle
      local Players = game:GetService("Players")
      local MouseEvent = Tool:WaitForChild("MouseEvent")
      local Mouse = Players.LocalPlayer:GetMouse()
      local ExpectingInput = false
      local IsMouseDown = false
      function OnEquipped(playerMouse)
      Mouse = playerMouse
      ExpectingInput = true
      IsMouseDown = false
      end
      function OnUnequipped()
      ExpectingInput = false
      IsMouseDown = false
      end
      function OnActivated()
      IsMouseDown = true
      end
      function OnDeactivated()
      IsMouseDown = false
      end
      Tool.Equipped:Connect(OnEquipped)
      Tool.Unequipped:Connect(OnUnequipped)
      Tool.Activated:Connect(OnActivated)
      Tool.Deactivated:Connect(OnDeactivated)

      game:GetService("RunService").Stepped:Connect(function()
      if IsMouseDown == true then
      MouseEvent:FireServer(Mouse.Hit.Position, Handle.Front.Position)
      end
      end)

    • @EpicityOfEpicness
      @EpicityOfEpicness 7 หลายเดือนก่อน +1

      @@Scrip_tix the problem changed to "Handle is not a valid member of Tool Players.DxrkShaadowVibez.Backpack.Pistol" line 2 so heres the local script for the gun
      local Tool = script.Parent
      local Handle = Tool.Handle
      local Players = game:GetService("Players")
      local MouseEvent = Tool:WaitForChild("MouseEvent")
      local Mouse = Players.LocalPlayer:GetMouse()
      local ExpectingInput = false
      local IsMouseDown = false
      function OnEquipped(playerMouse)
      Mouse = playerMouse
      ExpectingInput = true
      IsMouseDown = false
      end
      function OnUnequipped()
      ExpectingInput = false
      IsMouseDown = false
      end
      function OnActivated()
      IsMouseDown = true
      end
      function OnDeactivated()
      IsMouseDown = false
      end
      Tool.Equipped:Connect(OnEquipped)
      Tool.Unequipped:Connect(OnUnequipped)
      Tool.Activated:Connect(OnActivated)
      Tool.Deactivated:Connect(OnDeactivated)

      game:GetService("RunService").Stepped:Connect(function()
      if IsMouseDown == true then
      MouseEvent:FireServer(Mouse.Hit.Position, Handle.Front.Position)
      end
      end)

  • @Sk1jBoi
    @Sk1jBoi หลายเดือนก่อน

    do you *have* to, put the gun on the StarterPack? i want it to make it, so you have to grab it, then you can use it.

  • @BastePlayz
    @BastePlayz หลายเดือนก่อน

    when i put the gun i made in my starter pack it didnt show up in my inventory? does it only work with your model

    • @BastePlayz
      @BastePlayz หลายเดือนก่อน

      i checked output and it says
      12:12:42.940 Front is not a valid member of Part "Workspace.Baste513.Pistol.Handle" - Client - Pistol Gun Local Script:36

  • @officallink.
    @officallink. 6 หลายเดือนก่อน

    If i go to close to the enemy i wanna shoot, i cannot really (or cant literally) see the bullets, because of their size anymore

  • @Dk1n666
    @Dk1n666 5 หลายเดือนก่อน

    Hey, Script works perfectly fine but I was wondering if you could help me add an integrated system inside the preexisting scripts to play a bullet sound every time a bullet comes out of the gun. I can a write a separate script outside to match the weapons fire delay but once I start adding more guns I think I will run into some issues with timing. Can you help me write something that uses the fire delay variable?

  • @VassJagger
    @VassJagger 6 หลายเดือนก่อน +1

    This error looks like it shouldn't be happening i have copied it word for word and i dont know what to do, it is in line 18 for Local Script: local tween =TweenService:Create(bullet, tweenInfo, goal)
    Error Message
    01:27:49.996 Players.Drtrayblox123yea.PlayerScripts.LocalScript:18: attempt to index nil with 'Create' - Studio

    • @Scrip_tix
      @Scrip_tix  6 หลายเดือนก่อน

      Can you show me your code for the localscript?

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน

      @@Scrip_tix local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local Tween Service = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endpos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน

      @@Scrip_tix local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local Tween Service = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endpos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน +1

      @@Scrip_tix local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local Tween Service = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endpos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent = game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @VassJagger
      @VassJagger 6 หลายเดือนก่อน +1

      @@Scrip_tix
      Line 18 Error: Code
      local tween =TweenService:Create(bullet, tweenInfo, goal)

  • @StokBrood95
    @StokBrood95 7 หลายเดือนก่อน

    Question:Does this work for 2+ player servers(when tool.activated doesn't activate other tools from other clients)?

  • @KrisVyse-qe9je
    @KrisVyse-qe9je 9 หลายเดือนก่อน +1

    error:Infinite yield possible on 'ShotPart.Middle.Light:WaitForChild("Inner")

    • @Scrip_tix
      @Scrip_tix  9 หลายเดือนก่อน

      Show me your code :3

    • @Aika33700
      @Aika33700 8 หลายเดือนก่อน

      @@Scrip_tix you can't use :3 only me :3

    • @Architect532
      @Architect532 6 หลายเดือนก่อน

      @@Aika33700 mind being quiet?

    • @Aika33700
      @Aika33700 6 หลายเดือนก่อน

      @@Architect532 no

  • @phantom262
    @phantom262 5 หลายเดือนก่อน

    Ok i have the pistol working, please ignore my other comments. How would i change the script to make it only fire once with a small cooldown per mouseclick?

  • @UserXLol-hn4zv
    @UserXLol-hn4zv 5 หลายเดือนก่อน

    bro how do i fix when i click it fire but if i click once again its still fire can u pls fix

  • @ShadowWolf_0409
    @ShadowWolf_0409 7 หลายเดือนก่อน

    i don't understand, it doesn't show up in my inventory
    i try starter pack, i try starter player but it simply doesn't show up

    • @ShadowWolf_0409
      @ShadowWolf_0409 7 หลายเดือนก่อน

      If anyone can help just response

  • @WinstonDoesRoblox
    @WinstonDoesRoblox 8 หลายเดือนก่อน +2

    Hey its not working! I need help.
    local Tool = script.Parent
    local Handle = Tool.Handle
    local MouseEvent = Tool.MouseEvent
    local CanFire = true
    local MIN_BULLET_SPREAD_ANGLE = 0
    local MAX_BULLET_SPREAD_ANGLE = 0
    local FIRE_DELAY = 0.1
    local BULLETS_PER_SHOT = 1
    local RNG = Random.new()
    local TAU = math.pi * 2
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    function Fire(endPoint, startPos)
    if Tool.Parent:IsA("Backpack") then return end
    local direction = (endPoint - Handle.Front.Position).Unit
    local directionalCF = CFrame.new(Vector3.new(), direction)
    local newDirection = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true
    local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
    if raycastResult then
    if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
    CanFire = true
    end)
    i didnt know what to do at the end lol

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน

      Any errors in the output?

    • @WinstonDoesRoblox
      @WinstonDoesRoblox 8 หลายเดือนก่อน

      @@Scrip_tix no idk

  • @akvas2006
    @akvas2006 6 หลายเดือนก่อน

    how to make it shoot with one click and not by pressing the left mouse button?

  • @winforgee
    @winforgee 9 หลายเดือนก่อน

    Is it server sided? Do the shots appear on others screens?

    • @Scrip_tix
      @Scrip_tix  9 หลายเดือนก่อน +1

      The raycasting is done on the server side, with a RemoteEvent that fires to tell clients to create the bullet effects, so yes, the shots will appear on everyone else's screens :3

    • @winforgee
      @winforgee 9 หลายเดือนก่อน +1

      Yeah i noticed, I added reloading and SFX for the gun. Thanks for making the hard part lol@@Scrip_tix

  • @HrafnZoega
    @HrafnZoega 21 วันที่ผ่านมา

    My Python brain tried putting a colon so many times after any if/else statement.

  • @Sgamer1Yt
    @Sgamer1Yt 8 หลายเดือนก่อน

    Yo how to make shoot sounds when the gun shoots?

  • @winforgee
    @winforgee 6 หลายเดือนก่อน

    I been trying for the past 3 hours to make the raycast be destroyed after hitting a part, pls help

    • @Scrip_tix
      @Scrip_tix  6 หลายเดือนก่อน

      Can you show me your code? Are there any errors?

    • @winforgee
      @winforgee 6 หลายเดือนก่อน

      @@Scrip_tix Its not my code, its yours.In the video the shots also go through everything. Im not complaining it works fine, but i was wondering IF you could make a tutorial on how to make the bullet disappear after it touches a part. All my code is the same as your.

  • @Lucky_Rabbit12
    @Lucky_Rabbit12 10 หลายเดือนก่อน +9

    this too hard i gave up

    • @jomelynalejo1194
      @jomelynalejo1194 7 หลายเดือนก่อน +4

      Womp womp, who said coding was easy?

    • @MrPurpleGuy9
      @MrPurpleGuy9 7 หลายเดือนก่อน

      Me also

    • @Architect532
      @Architect532 6 หลายเดือนก่อน

      weakling.

    • @yenj36
      @yenj36 5 หลายเดือนก่อน

      Yeah me either

    • @MrPurpleGuy9
      @MrPurpleGuy9 5 หลายเดือนก่อน

      @@yenj36 lol

  • @MrFIincher
    @MrFIincher 8 หลายเดือนก่อน

    btw I did it on First Person but then it doenst shoot anymore
    what do I do???

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน

      Interesting, it still works for me after doing in first person. Can you show me your code?

    • @MrFIincher
      @MrFIincher 8 หลายเดือนก่อน

      @@Scrip_tix Assault Rifle Script
      local tool = script.Parent
      local handle = tool.Handle
      local MouseEvent = tool:WaitForChild("MouseEvent")
      local CanFire = true
      local MIN_BULLET_SPREAD_ANGLE = 0
      local MAX_BULLET_SPREAD_ANGLE = 0
      local FIRE_DELAY = 0.25
      local BULLETS_PER_SHOT = 1
      local RNG = Random.new()
      local TAU = math.pi * 2
      local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      function Fire(endpoint, starPos)

      if tool.Parent:IsA("BackPack") then return end

      local direction = (endpoint - handle.Front.Position).Unit
      local direcitonCF = CFrame.new(Vector3.new(), direction)
      local newDirection = (directionCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector

      local raycastParams = RaycastParams.new()
      raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
      raycastParams.FilterType = Enum.RaycastFilterType.Exclude
      raycastParams.IgnoreWater = true

      local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
      if raycastResult then

      if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
      CanFire = true

      end)

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน +2

      You seem to be misspelling quite a few variables, ensure that you have spelt everything correctly and consistently. (ex: 'startPos' vs 'starPos', 'lookVector' vs 'LookVector', 'directionCF' vs 'direcitonCF', etc).

  • @oddconstantine
    @oddconstantine 10 หลายเดือนก่อน

    How long have you been scripting

  • @MinkeyKing-kh4he
    @MinkeyKing-kh4he 4 หลายเดือนก่อน

    if only there was something could copy and paste the copy then i wouldn't take so long

  • @Lucky_Rabbit12
    @Lucky_Rabbit12 10 หลายเดือนก่อน

    dose it also shoot pepole if it dose can u pls make it not shoot pepole only like npc??

    • @Scrip_tix
      @Scrip_tix  10 หลายเดือนก่อน

      When you're checking if they have a humanoid, you can also do:
      if not game:Players:FindFirstChild(hitPart.Parent.Name) then

    • @Lucky_Rabbit12
      @Lucky_Rabbit12 10 หลายเดือนก่อน

      @@Scrip_tix ok thx

  • @limestoneshine6595
    @limestoneshine6595 10 หลายเดือนก่อน +1

    cool

  • @Drxpyoutube
    @Drxpyoutube 6 หลายเดือนก่อน

    bro i did the whole thing correct and it didnt work

  • @Drxpyoutube
    @Drxpyoutube 6 หลายเดือนก่อน +1

    local tool = script.Parent
    local handle = tool.Handle
    local players = game:GetService("Players")
    local MouseEvent = tool:WaitForChild("MouseEvent")
    local Mouse = Players.LocalPlayer:GetMouse()
    local ExpectingInput = false
    local IsMouseDown = false
    function OnEquipped(playerMouse)
    Mouse = playerMouse
    ExpectingInput = true
    IsMouseDown = false
    end
    function OnUnequipped()
    ExpectingInput = false
    IsMouseDown = false
    end
    function OnActivated()
    IsMouseDown = true
    end
    function OnDeactivated()
    IsMouseDown = false
    end
    tool.Equipped:Connect(OnEquipped)
    tool.Unequipped:Connect(OnUnequipped)
    tool.Activated:Connect(OnActivated)
    tool.Deactivated:Connect(OnDeactivated)
    game:GetService("RunService").Stepped:Connect(function()
    if IsMouseDown == true then
    MouseEvent:FireServer(Mouse.Hit.Position, handle.Front.Postion
    end
    end)

  • @GrigoreAlex1302
    @GrigoreAlex1302 8 หลายเดือนก่อน

    Bro, the raycast dosent work

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน

      It should, as I have just demonstrated it. Can I see your code?

    • @GrigoreAlex1302
      @GrigoreAlex1302 8 หลายเดือนก่อน

      Nevermind, i fixed it

  • @bionx9098
    @bionx9098 11 ชั่วโมงที่ผ่านมา

    How tf did you learn all this shi#?

  • @maximusprime1124
    @maximusprime1124 หลายเดือนก่อน

    this was very confusing

  • @BrainrotSongs
    @BrainrotSongs 6 หลายเดือนก่อน

    it didnt work.

    • @Scrip_tix
      @Scrip_tix  6 หลายเดือนก่อน

      Are there any errors in the output?

  • @blablawhite6303
    @blablawhite6303 9 หลายเดือนก่อน +1

    Now make a part 2 where you have to click "R" to reload

  • @phantom262
    @phantom262 5 หลายเดือนก่อน

    For some reason my gun is unable to shoot bullets. this is the output for whenever i click
    21:56:29.060 Gun Testing Place.rbxl auto-recovery file was created - Studio
    21:56:34.987 Infinite yield possible on 'Players.dietsoda13.Backpack.Pistol:WaitForChild("MouseEvent")' - Studio
    21:56:34.987 Stack Begin - Studio
    21:56:34.987 Script 'Players.dietsoda13.Backpack.Pistol.Script', Line 3 - Studio - Script:3
    21:56:34.988 Stack End - Studio
    21:56:35.039 Infinite yield possible on 'Players.dietsoda13.Backpack.Pistol:WaitForChild("MouseEvent")' - Studio
    21:56:35.039 Stack Begin - Studio
    21:56:35.039 Script 'Players.dietsoda13.Backpack.Pistol.LocalScript', Line 4 - Studio - LocalScript:4
    21:56:35.039 Stack End - Studio

    • @phantom262
      @phantom262 5 หลายเดือนก่อน

      Local script in gun
      local tool = script.Parent
      local handle = tool.Handle
      local Players = game:GetService("Players")
      local MouseEvent = tool:WaitForChild("MouseEvent")
      local Mouse = Players.LocalPlayer:GetMouse()
      local ExpectingInput = false
      local IsMouseDown = false
      function OnEquipped(playerMouse)
      Mouse = playerMouse
      ExpectingInput = true
      IsMouseDown = false
      end
      function OnUnequipped()
      ExpectingInput = false
      IsMouseDown = false
      end
      function OnActivated()
      IsMouseDown = true
      end
      function OnDeactivated()
      IsMouseDown = false
      end
      tool.Equipped:Connect(OnEquipped)
      tool.Unequipped:Connect(OnUnequipped)
      tool.Activated:Connect(OnActivated)
      tool.Deactivated:Connect(OnDeactivated)
      game:GetService("RunService").Stepped:Connect(function()
      if IsMouseDown == true then
      MouseEvent:FireServer(Mouse.Hit.Position, handle.Front.Position)
      end
      end)

    • @phantom262
      @phantom262 5 หลายเดือนก่อน

      The other script in the gun
      local tool = script.Parent
      local handle = tool.Handle
      local MouseEvent = tool:WaitForChild("MouseEvent")
      local CanFire = true
      local MIN_BULLET_SPREAD_ANGLE = 0
      local MAX_BULLET_SPREAD_ANGLE = 0
      local FIRE_DELAY = 0.25
      local BULLETS_PER_SHOT = 1
      local RNG = Random.new()
      local TAU = math.pi * 2
      local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      function Fire(endpoint, startpos)
      if tool.parent:IsA("Backpack") then return end

      local direction = (endpoint - handle.Front.Position).Unit
      local directionCF = CFrame.new(Vector3.new(), direction)
      local newDirection = (directionCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).lookVector

      local raycastParams = RaycastParams.new()
      raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
      raycastParams.FilterType = Enum.RaycastFilterType.Exclude
      raycastParams.IgnoreWater = true

      local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
      if raycastResult then

      if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
      CanFire = true

      end)

    • @phantom262
      @phantom262 5 หลายเดือนก่อน

      starter player script
      local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
      local TweenService = game:GetService("TweenService")
      local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
      local RunService = game:GetService("RunService")
      local DebrisService = game:GetService("Debris")
      local function visualize(startPos, endPos, distance, color)

      local bullet = ShotPart:Clone()
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(color)
      bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(color)
      bullet.Position = startPos

      local goal = {}
      goal.Position = endPos
      local tweenInfo = TweenInfo.new(distance/500)
      local tween =TweenService:Create(bullet, tweenInfo, goal)
      DebrisService:AddItem(bullet, distance/500)
      bullet.Parent =game.Workspace

      RunService.RenderStepped:Wait()
      RunService.RenderStepped:Wait()

      tween:Play()

      end
      VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @phantom262
      @phantom262 5 หลายเดือนก่อน

      welp i fiddled with it, i misnamed the MouseEvent as Mouse event. now im getting this:
      09:47:25.936 Front is not a valid member of Part "Workspace.dietsoda13.Pistol.Handle" - Client - LocalScript:36
      09:47:25.936 Stack Begin - Studio
      09:47:25.936 Script 'Players.dietsoda13.Backpack.Pistol.LocalScript', Line 36 - Studio - LocalScript:36
      09:47:25.937 Stack End - Studio

    • @phantom262
      @phantom262 5 หลายเดือนก่อน

      ok so it works on the gun you provided, i was trying to use a model i made. clearly that won't work too well

  • @R3XX3R_RED
    @R3XX3R_RED 3 หลายเดือนก่อน

    my output says "unable to cast instance to vector3"
    its a line 30
    its the regular script in the assault rifle
    i dont think it has anything to do with the modle i made since i used the bullet you used and arrange all the parents and children like yours
    heres all my code(its all the same as yours i think)
    local Tool = script.Parent
    local Handle = Tool.Handle
    local MouseEvent = Tool:WaitForChild("MouseEvent")
    local CanFire = true
    local MIN_BULLET_SPREAD_ANGLE = 0
    local MAX_BULLET_SPREAD_ANGLE = 0
    local FIRE_DELAY = 0.2
    local BULLETS_PER_SHOT = 1
    local RNG = Random.new()
    local TAU = math.pi * 2
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    function Fire(endPoint, startPos)
    if Tool.Parent:IsA("Backpack") then return end
    local direction = (endPoint - Handle.Front.Position).Unit
    local directionalCF = CFrame.new(Vector3.new(), direction)
    local newDirection = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true
    local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
    if raycastResult then
    if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
    CanFire = true
    end)

  • @Trife_to_be_triver
    @Trife_to_be_triver หลายเดือนก่อน

    bro just use smth from the toolbox

  • @Drxpyoutube
    @Drxpyoutube 6 หลายเดือนก่อน

    local tool = script.Parent
    local handle = tool.Handle
    local MouseEvent = tool:WaitForChild("MouseEvent")
    local CanFire = true
    local MIN_BULLET_SPREAD_ANGLE = 0
    local MAX_BULLET_SPREAD_ANGLE = 0
    local FIRE_DELAY = 0.25
    local BULLETS_PER_SHOT = 1
    local RNG = Random.new()
    local TAU = math.pi * 2
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    function Fire(endpoint, startPos)

    if tool.Parent:isA("Backpack") then return end

    local diretion = (endpoint - handle.Front.Position)Unit
    local direction = CFrame.new(Vector3.new(), direction)
    local newDirection = (directionCF * CFrame.FromOrientation(0, 0, RNG:NextNumber(0,TAU)) * CFrame.FromOrientation(math.Rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector

    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true

    local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
    if raycastResult then

    if raycastResult.Distance 0.03 then task.wait(Fire_Delay) end
    CanFire = true
    end)

  • @gunstargamingkv6760
    @gunstargamingkv6760 8 หลายเดือนก่อน +1

    NOT WORKING PLS HELP
    ASSAULT RIFFLE
    SCRIPT
    local Tool = script.Parent
    local Handle = Tool.Handle
    local MouseEvent = Tool.MouseEvent
    local CanFire = true
    local MIN_BULLET_SPREAD_ANGLE = 0
    local MAX_BULLET_SPREAD_ANGLE = 0
    local FIRE_DELAY = 0.1
    local BULLETS_PER_SHOT = 1
    local RNG = Random.new()
    local TAU = math.pi * 2
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    function Fire(endPoint, startPos)
    if Tool.Parent:IsA("Backpack") then return end
    local direction = (endPoint - Handle.Front.Position).Unit
    local directionalCF = CFrame.new(Vector3.new(), direction)
    local newDirection = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent.Parent}
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true
    local raycastResult = workspace:Raycast(startPos, newDirection * 250, raycastParams)
    if raycastResult then
    if raycastResult.Distance 0.03 then task.wait(FIRE_DELAY) end
    CanFire = false
    end)
    LOCAL SCRIPT
    local tool = script.Parent
    local handle = tool.handle
    local players = game:GetService('Players')
    local MouseEvent = tool:WaitForChild("MouseEvent")
    local Mouse = Players.LocalPlayers:GetMouse()
    local ExpectingInput = false
    local IsMouseDown = false
    function OnEquipped(playermouse)
    Mouse = playermouse
    ExpectingInput = true
    IsMouseDown = false
    end
    function OnUnequipped()
    ExpectingInput = false
    IsMouseDown = false
    end
    function OnActivated()
    IsMouseDown = true
    end
    function OnDeactivated()
    IsMouseDown = false
    end
    tool.Equipped:Connect(OnEquipped)
    tool.Unequipped:Connect(OnUnequipped)
    tool.Activated:Connect(OnActivated)
    tool.Deactivated:Connect(OnDeactivated)
    game:GetService("RunService").Stepped:Connect(function()
    if IsMouseDown == true then
    MouseEvent:FireServer(Mouse.Hit.Position, handle.front.Position)
    end
    end)
    STARTER PLAYER PACK LOCAL SCRIPT
    local VisualizeBulletsEvent = game:GetService("ReplicatedStorage"):WaitForChild("VisualizeBulletsEvent")
    local TweenService = game:GetService("TweenService")
    local ShotPart = game:GetService("ReplicatedStorage"):WaitForChild("ShotPart")
    local RunService = game:GetService("RunService")
    local DebrisService = game:GetService("Debris")
    local function visualize(startPos, endPos, distance, colour)

    local bullet = ShotPart:Clone()
    bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Inner").Color = ColorSequence.new(colour)
    bullet:WaitForChild("Middle"):WaitForChild("Trails"):WaitForChild("Outter").Color = ColorSequence.new(colour)
    bullet:WaitForChild("Middle"):WaitForChild("Light").Color = Color3.new(colour)
    bullet.Position = startPos

    local goal = {}
    goal.Position = endPos
    local tweenInfo = TweenInfo.new(distance\500)
    local tween =TweenService:Create(bullet, tweenInfo, goal)
    DebrisService:AddItem(bullet, distance\500)
    bullet.Parent = game.Workspace

    RunService.RenderStepped:Wait()
    RunService.RenderStepped:Wait()

    tween:PLAY()

    end
    VisualizeBulletsEvent.OnClientEvent:Connect(visualize)

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน

      Any errors in the output? Also, in the assault rifle script, you wrote "LookVector" instead of "lookVector"

    • @gunstargamingkv6760
      @gunstargamingkv6760 8 หลายเดือนก่อน

      Thank you so much for replying so fast! I will check if there is any error in the output and tell it to you thank you so much

    • @gunstargamingkv6760
      @gunstargamingkv6760 8 หลายเดือนก่อน

      bro in the output it sayinh that .Backpack.Assault Rifle.LocalScript:6: attempt to index nil with 'LocalPlayers'

    • @gunstargamingkv6760
      @gunstargamingkv6760 8 หลายเดือนก่อน

      now i found that p in players was not in caps at line 3 so i changed it and now its saying LocalPlayers is not a valid member of Players "Players"

    • @Scrip_tix
      @Scrip_tix  8 หลายเดือนก่อน

      It's 'LocalPlayer' not "LocalPlayers"