remote.OnServerEvent:Connect(function(Player, Value, Value2, mousePos)
local character = Player.Character
elseif Value == “fireball” then
local fireball = game:GetService("ReplicatedStorage"):FindFirstChild("Fireball"):Clone()
fireball.Parent = game.Workspace
fireball.Size = Vector3.new(2, 2, 2)
fireball.CFrame = character:WaitForChild("HumanoidRootPart").CFrame * CFrame.new(0, 10, 0)
fireball.Massless = true
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 0, false, 0)
local properties = {
Color = Color3.fromRGB(255, 0, 0),
Size = Vector3.new(15, 15, 15),
Anchored = true
}
local Tween = TweenService:Create(fireball, Info, properties)
Tween:Play()
Tween.Completed:Wait()
fireball.Anchored = false
local bv = Instance.new("BodyVelocity", fireball)
bv.Velocity = CFrame.new(fireball.CFrame.Position, mousePos).lookVector * 50
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
How many parameters do I need? and why cant it find the mousePos in the function
this is the one in the local script
if Input.KeyCode == Enum.KeyCode.R and not debounce then
debounce = true
isPressed = true
remote:FireServer(“fireball”, CFrame, player:GetMouse().Hit.p)
wait()
debounce = false
end