Hi. A local script inside a tool fires a RemoteEvent also placed inside the tool when activated with the arguments of:
firere:FireServer(mouse, hum, handle, damage, flyoffvals)
The script that runs when RemoteEvent is fired looks like this:
local firere = script.Parent:WaitForChild("Fire") firere.OnServerEvent:connect(function(player, mouse, hum, handle, damage, flyoffvals) local fb = handle:Clone() fb.Parent = game.Workspace fb.Name = "Fireball" fb.CFrame = handle.CFrame print(player.Name .. "'s fireball was launched!") local particle = fb:WaitForChild("ParticleEmitter") particle.LockedToPart = false particle.Rate = 300 local bv = Instance.new("BodyVelocity", fb) bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge) bv.Velocity = mouse.Hit.lookVector * 350 print(player.Name .. "'s fireball BodyVelocity was created!") game.Debris:AddItem(fb, 1.5) fb.Touched:connect(function(part) local vhum = part.Parent:findFirstChild("Humanoid") if vhum and vhum.Health > 0 and vhum ~= hum then vhum:TakeDamage(damage) for x = 1,10 do local cfb = fb:Clone() cfb.Parent = game.Workspace cfb.Position = fb.Position cfb.BodyVelocity.Velocity = Vector3.new(flyoffvals[math.random(1, #flyoffvals)], flyoffvals[math.random(1, #flyoffvals)], flyoffvals[math.random(1, #flyoffvals)]) game.Debris:AddItem(cfb, 1.5) end fb:Destroy() elseif part.Anchored == true and part.CanCollide == true then for x = 1,10 do local cfb = fb:Clone() cfb.CFrame = fb.CFrame cfb.BodyVelocity.Velocity = Vector3.new(flyoffvals[math.random(1, #flyoffvals)], flyoffvals[math.random(1, #flyoffvals)], flyoffvals[math.random(1, #flyoffvals)]) game.Debris:AddItem(cfb, 1.5) end fb:Destroy() end end) end)
I'm getting the error at line 19. I'm getting the player's mouse using "player:GetMouse()" inside the local script. All help is appreciated very, very much. Thanks :} ~Loughdough
To the server mouse does not exist. Try just sending the lookVector instead of the mouse.