of     1   

PureConcept
#180772416Thursday, December 31, 2015 9:28 PM GMT

--// Script in ServerscriptService local Shoot = game:GetService('ReplicatedStorage'):WaitForChild'Shoot' Shoot.OnServerEvent:connect(function(player, beginpos, endpos, accuracy, tool) endpos = endpos * math.random(accuracy, 1) local ray = Ray.new(beginpos, (endpos - beginpos).unit) local hit = game.Workspace:FindPartOnRay(ray) if (player.Character.Torso.Position - hit.Position).magnitude <= 5 then return end local PartbyRay = Instance.new('Part', game.Workspace) PartbyRay.BrickColor = player.TeamColor PartbyRay.Locked = true PartbyRay.Anchored = true PartbyRay.Transparency = 0.8 PartbyRay.TopSurface = 'Smooth' PartbyRay.BottomSurface = 'Smooth' PartbyRay.Size = Vector3.new(0.2, 0.2, ((beginpos - endpos).magnitude)) PartbyRay.CFrame = tool.Handle.Barrel.CFrame game:GetService('Debris'):AddItem(PartbyRay, 0.1) end) --// Localscript local UIS = game:GetService('UserInputService') local p = game.Players.LocalPlayer local tool = script.Parent repeat wait() until p.Character local handle = tool:WaitForChild'Handle' local barrel = handle:WaitForChild'Barrel' local Mag = handle:WaitForChild'Mag' local Aim = handle:WaitForChild'Aim' local c = p.Character local mouse = p:GetMouse() UIS.InputBegan:connect(function(input, gPE) if not gPE then if input.UserInputType == Enum.UserInputType.MouseButton1 then if ammo > 0 then Firing = true else Firing = false Reload() end end end end) UIS.InputEnded:connect(function(input, gPE) if not gPE then if input.UserInputType == Enum.UserInputType.MouseButton1 then Firing = false end end end) while wait() do if Firing == true then if mode == 'Auto' then wait(1 / (gunmodule.AutoBulletsPerSecond)) elseif mode == 'Semi' then wait(1) end Shoot:FireServer(handle.CFrame.p, mouse.Hit.p, gunmodule.Accuracy, tool) ammo = ammo - 1 end end Accuracy = math.random(0.98, 1) Why is this shooting all over the place -.- The Legend of Heroes Sen no Kiseki
PureConcept
#180772453Thursday, December 31, 2015 9:29 PM GMT

Accuracy = 0.98** The Legend of Heroes Sen no Kiseki
KingJacko
#180773793Thursday, December 31, 2015 9:47 PM GMT

whats wrong? You have to tell us.
ray_revenge
#180774065Thursday, December 31, 2015 9:51 PM GMT

PartbyRay.CFrame = tool.Handle.Barrel.CFrame * CFrame.new(0,0,-(beginpos-endpos).magnitude/2)
PureConcept
#180775347Thursday, December 31, 2015 10:09 PM GMT

The bullets aren't shooting correctly the um endpos is messed up I guess you can say The Legend of Heroes Sen no Kiseki
PureConcept
#180775870Thursday, December 31, 2015 10:16 PM GMT

local Shoot = game:GetService('ReplicatedStorage'):WaitForChild'Shoot' Shoot.OnServerEvent:connect(function(player, beginpos, endpos, accuracy, maxdistance, tool) -- endpos = endpos * math.random(accuracy, 1) local ray = Ray.new(beginpos, (endpos - beginpos).unit) local hit = game.Workspace:FindPartOnRay(ray) if hit and hit ~= player.Character then if (player.Character.Torso.Position - hit.Position).magnitude <= 5 then return else if hit.Parent:FindFirstChild'Humanoid' then hit.Parent.Humanoid:TakeDamage(10) end end end local PartbyRay = Instance.new('Part', game.Workspace) PartbyRay.Locked = true PartbyRay.Anchored = true PartbyRay.Transparency = 0.8 PartbyRay.TopSurface = 'Smooth' PartbyRay.BottomSurface = 'Smooth' PartbyRay.Size = Vector3.new(0.2, 0.2, ((beginpos - endpos).magnitude)) PartbyRay.CFrame = tool.Handle.Barrel.CFrame * CFrame.new(0,0,-(beginpos-endpos).magnitude/2) game:GetService('Debris'):AddItem(PartbyRay, 0.1) end) Is there like something wrong with my PartbyRay Size and Ray? The Legend of Heroes Sen no Kiseki

    of     1