local script:
userInputService.InputBegan:connect(function(inputObject)
if inputObject.UserInputType == Enum.UserInputType.Keyboard then
if inputObject.KeyCode == Enum.KeyCode.Z then
--if playerData.grimoireType.Value == "fire" then
if canExecute and canUseExplodingFireBall and playerData.grimoireIsOpen.Value == true then
canExecute = false
canUseExplodingFireBall = false
request.fireGrimoireHandler:FireServer(playerMouse.Hit.p, "explodingFireBall")
wait(0.75)
canExecute = true
wait(4)
canUseExplodingFireBall = true
end
--end
end
end
end)
server script:
request.fireGrimoireHandler.OnServerEvent:connect(function(player, mousePosition, spell)
local playerData = replicatedStorage.dataHolder[player.UserId]
local character = player.Character
local root = character.HumanoidRootPart
if spell == "explodingFireBall" then
local explodingFireBall = assets.spells.fire.explodingFireBall:Clone()
explodingFireBall.Name = player.Name .. "'s exploding fire ball!"
explodingFireBall.Parent = workspace
weldBetween(explodingFireBall, character["RightHand"], CFrame.new(0, 0.75, 0))
local bodyVelocity = Instance.new("BodyVelocity", explodingFireBall)
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Velocity = (mousePosition - explodingFireBall.Position).unit * 100
explodingFireBall.partWeld:Destroy()
game.Debris:AddItem(explodingFireBall, 2)
end
end)
I need help making it so that instead of getting the mouse's position when pressing the key, I get the mouse's position when I remove the weld. Or something along those lines.
bodyVelocity.Velocity = (mousePosition - explodingFireBall.Position).unit * 100
explodingFireBall.partWeld:Destroy()
I honestly tried my best explaining this. I'm probably overthinking it and it's something simple.

2 comments
That's a lot of code to sift through all at once, but I think the way I would do it is as soon as you remove the weld, call a RemoteFunction that returns the mouse's current position from a localscript.
@DropshipPilot Thanks, will try that now.