Hey there, I have been trying to work on a grenade projectile to make it chargeable, for example, the main velocity is 100, that is the default. But I want the velocity to be changed when the grenade has been held for a certain time. Example, if it’s held for .5 seconds then the velocity will now be 200.
–Serverscript
local hold; local throw; local reload
script.Parent.GrenadeEvent.OnServerEvent:Connect(function(player, mouseDirection, holdTime, GrenadeType)
local char = player.Character
local humanoid = char:FindFirstChild("Humanoid")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
if GrenadeType == "Hold" then
-- Get Animations
script.Parent.Handle.Armed:Play()
if not hold then hold = humanoid:LoadAnimation(script.Hold) end
hold:Play()
elseif GrenadeType == "Throw" then
script.Parent.Handle.Throw:Play()
if not hold then hold = humanoid:LoadAnimation(script.Hold) end
hold:Stop()
if not throw then throw = humanoid:LoadAnimation(script.Throw) end
throw:Play()
wait(.15)
script.Parent.Handle.Transparency = 1
-- Making the grenade
local clonedGrenade = script.Parent.Handle:Clone()
clonedGrenade.Transparency = 0
clonedGrenade.CanCollide = true
clonedGrenade.Parent = workspace
clonedGrenade.CFrame = CFrame.new(script.Parent.Handle.Position,mouseDirection)
clonedGrenade.Velocity = clonedGrenade.CFrame.lookVector * 100
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local held = false
mouse.Button1Down:connect(function()
held = true
print("left mouse button held")
wait(0.5)
clonedGrenade.Velocity = clonedGrenade.CFrame.LookVector * 5000
end)
mouse.Button1Up:connect(function()
held = false
print("left mouse button pressed")
end)
spawn(function()
while true do
wait(.1)
print(held)
end
end)
wait(9999-holdTime)
-- Make an explosion
--clonedGrenade.Transparency = 1
--local explosion = Instance.new("Explosion",workspace)
--explosion.Position = clonedGrenade.Position
--explosion.BlastRadius = 25
local explosionSFX = script.Parent.Handle.Explosion:Clone()
explosionSFX.Parent = clonedGrenade
explosionSFX:Play()
wait(5)
clonedGrenade:Destroy()
elseif GrenadeType == "Explode" then
hold:Stop()
script.Parent.Handle.Transparency = 1
local explosion = Instance.new("Explosion",workspace)
explosion.DestroyJointRadiusPercent = 0
explosion.BlastRadius = 25
explosion.Position = script.Parent.Handle.Position
script.Parent.Handle.Explosion:Play()
humanoid:TakeDamage(0)
humanoid.WalkSpeed = 0
elseif GrenadeType == "Reload" then
if not reload then reload = humanoid:LoadAnimation(script.Reload) end
reload:Play()
wait(.8)
script.Parent.Handle.Transparency = 0
humanoid.WalkSpeed = 16
end
end)
script.Parent.Unequipped:Connect(function()
if hold then hold:Stop() end; if throw then throw:Stop() end; if reload then reload:Stop() end
end)
If you can give feedback please help, 
