i have a projectile script:
local sound = script.fire
local tweenservice = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local tear1 = game.ReplicatedStorage.Player1tear
local UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
print("Working")
sound:Play()
local clonetear = tear1:Clone()
-- Touched event
clonetear.Touched:Connect(function(hit)
local hitHumanoid = hit.Parent:FindFirstChildOfClass("Humanoid") -- Check for a humanoid
if hitHumanoid then
-- You'll need to set up some remote events to deal real damage.
hitHumanoid:TakeDamage(game.StarterPlayer.StarterPlayerScripts.TearScript.Damage.Value) -- Deal damage
game.Debris:AddItem(0, clonetear) -- Remove projectile
end
end)
clonetear.Parent = game.Workspace
clonetear.CFrame = plr.Character.HumanoidRootPart.CFrame + plr.Character.HumanoidRootPart.CFrame.lookVector * 5
tweenservice:Create(clonetear,TweenInfo.new(1,0,0),{CFrame = plr.Character.HumanoidRootPart.CFrame + plr.Character.HumanoidRootPart.CFrame.lookVector * 40,Transparency = 1},Enum.EasingStyle.Quint,Enum.EasingDirection.Out):Play()
game.Debris:AddItem(2.5,clonetear)
end
end)
theres a sound under the script called fire, a value under the script called damage and the projectile in replicated storage called player1tear. right now to shoot rapidly you need to spam the e key. i need it so that you can hold down the e key and the projectiles will shoot with custom firerate value.

1 comment
the ")" in the last end is red lined,