local replicatedstorage = game:GetService("ReplicatedStorage") local remoteevent = replicatedstorage:WaitForChild("ShotEvent") remoteevent.OnServerEvent:Connect(function(player, gunpos, moupos) local bullet = Instance.new("Part") bullet.Name = "Bullet" bullet.Parent = game.Workspace bullet.Position = gunpos local distance = (moupos - gunpos).magnitude local speed = 500 bullet.CFrame = CFrame.new(gunpos, moupos) bullet.Velocity = bullet.CFrame.lookVector * speed end)
up there is code but i understand everything except this part(i understand "local speed = 500")
local distance = (moupos - gunpos).magnitude local speed = 500 bullet.CFrame = CFrame.new(gunpos, moupos) bullet.Velocity = bullet.CFrame.lookVector * speed