Need Help with Parameters

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

It doesn’t look like you’re using the Value2 parameter, so just get rid of it. Value2 is being treated as the Position of the mouse.Hit

- remote.OnServerEvent:Connect(function(Player, Value, Value2, mousePos)
+ remote.OnServerEvent:Connect(function(player, value, mousePos)
1 Like

I am using it on another skill

Then pass that skill before passing the mouse position.

this works if I didnt have a second value

but I also need it is it possible to have 3 parameters?

Yes, pass whatever CFrame you meant to pass. Then send the Position.

remote:FireServer("fireball", cframe, player:GetMouse().Hit.Position)

also please don’t send screenshots of code

1 Like

Thanks a lot, noted!.

dadadadadssorry 3 0 chars