i only have the key part but not quite the shooting part (btw i want the part to be cloned from replacted storage)
local UIS = game:GetService("UserInputService")
local Character = script.Parent
local Npc = game.Workspace.Npc
local camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Lol = game.Workspace.Lol
UIS.InputBegan:Connect(function(Key, Chatted)
if Chatted then
return
end
if Key.KeyCode == Enum.KeyCode.E then
--i guess this is where the shooting part goes
end
local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local camera = workspace.CurrentCamera
local Player = Players.LocalPlayer
local pathToThePart = ReplicatedStorage.Part
UIS.InputBegan:Connect(function(Key, Chatted)
if Chatted then
return
end
if Key.KeyCode == Enum.KeyCode.E then
--i guess you mean this
local projectile = pathToThePart
projectile.Parent = workspace
projectile.CFrame = Player.Character.HumanoidRootPart.CFrame
projectile.Velocity = camera.CFrame.LookVector * 10000
end
end)