This is a support category for asking questions about how to get something done on the Roblox websites or how to do something on Roblox applications such as Roblox Studio.
You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
A gun. -
What is the issue? Include screenshots / videos if possible!
movement delay with the bullet
local script:
local gun = script.Parent
local handle = gun.Handle
local gunBulletHole = gun.BulletHole
local remote = gun.RemoteEvent
local rs = game:GetService("ReplicatedStorage")
local bullets = rs:WaitForChild("Bullets")
local bulletHole = bullets:WaitForChild("BulletHole")
local pistolBullet = bullets:WaitForChild("Pistol")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
remote:FireServer(mouse.Hit.Position)
print("Shot")
end)
server script:
local rs = game:GetService("ReplicatedStorage")
local bullets = rs.Bullets
local pistolBullet = bullets.Pistol
local gun = script.Parent
local remote = gun.RemoteEvent
remote.OnServerEvent:Connect(function(player, mousePos)
local bullet = pistolBullet:Clone()
bullet.Parent = workspace
bullet.CFrame = CFrame.new(gun.BulletHole.Position, mousePos)
local attachment = Instance.new("Attachment", bullet)
local lv = Instance.new("LinearVelocity", attachment)
lv.MaxForce = math.huge
lv.VectorVelocity = bullet.CFrame.LookVector * 100
lv.Attachment0 = attachment
game.Debris:AddItem(bullet, 3)
end)
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I have tried using body velocity instead.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!