How can i create a keybind to shoot projectile script?

So i made a ice arrow:
image

And i had a local script in the starter pack which i wrote for Press X to shoot ( it works perfectly fine because i used this for the first move) So I am trying to create a script that could create 4 clones of the projectile (IceArrows) and launch toward the mouse position (which would be in ServerScriptService)

How can i create it?

The local script in StarterPack:

wait(1)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")


local Remote = ReplicatedStorage:WaitForChild("IceRemoteX")
local Player = game.Players.LocalPlayer
local Character = Player.Character


local CoolDown = true
local Key = "X"


local Animation = script.Animation
local Humanoid = Character:WaitForChild("Humanoid")

local LoadedAnimation = Humanoid:LoadAnimation(Animation) 




UserInputService.InputBegan:Connect(function(Input, IsTyping)
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if KeyPressed == Enum.KeyCode[Key] and CoolDown and Character then
		CoolDown = false
		Humanoid.WalkSpeed = 0
		Humanoid.AutoRotate = false

		LoadedAnimation:Play()
		wait(1.5)
		Remote:FireServer()
		wait(1.5)
		Humanoid.WalkSpeed = 16
		Humanoid.AutoRotate = true


		wait(3)
		CoolDown = true 
	end
end)

Creating Projectiles - #14 by xKaihatsu do some research, there’s a lot of threads about projectiles.

1 Like

you should make the arrow clones union, and then add a “BodyVelocity” inside them. “BodyVelocity” makes your parts looks like flying