Got this line in my script and idk hjow to fix it
local RemoteFunction = ReplicatedStorage:WaitForChild("RemoteFunction")
local Bullet = ReplicatedStorage:WaitForChild("Bullet")
local tool = script.Parent
local bulletSpeed = 200
local bulletDamage = 15
local fireRate = 0.1
local canDamage = false
local shooting = false
tool.Activated:Connect(function()
if shooting == false then
shooting = true
local player = game.Players:GetPlayerFromCharacter(tool.Parent)
local MouseHitLookVector = RemoteFunction:InvokeClient(player)
local newBullet = Bullet:Clone()
newBullet.CFrame = tool.Handle.CFrame
newBullet.Parent = game.Workspace
newBullet.Velocity = MouseHitLookVector * bulletSpeed
local BulletTouch
BulletTouch = newBullet.Touched:Connect(function(hit)
newBullet.velocity = 0
if hit.Parent then
local hitHumanoid = newBullet.Parent:FindFirstChild("Humanoid")
if not hitHumanoid then
return
end
if hitHumanoid then
hitHumanoid:TakeDamage(bulletDamage)
newBullet.Transparency = 1
end
BulletTouch:Disconnect()
wait(fireRate)
shooting = false
end
end)
print("Working")```