What's supposed to happen is when you hold down the Z key, a shockwave mesh part will appear under you and grow and become transparent repeatedly. That part of it works. It's supposed to turn off when you let go. What's actually happening is when you press z it does the tween but when you let go nothing happens. Also when you press z again it doubles up with the thing that was supposed to stop.
local remote = game:GetService("ReplicatedStorage"):FindFirstChild("MagicCharging")
local tweenS = game:GetService("TweenService")
-- Assets --
local assetsFolder = game.ServerStorage.WaterElement
remote.OnServerEvent:Connect(function(player, action)
local character = player.Character
local HRP = character:FindFirstChild("HumanoidRootPart")
local humanoid = character.Humanoid
if action == "start_charge" then
print(action)
while true do
local wc_new = assetsFolder.WaterCharge:Clone()
wc_new.Anchored = true
wc_new.CanCollide = false
wc_new.Material = "Neon"
wc_new.Position = HRP.Position - Vector3.new(0, 2.5, 0)
wc_new.Parent = game.Workspace
local goal = {}
goal.Size = Vector3.new(17.526, 1.932, 17.086)
goal.Transparency = 1
local info = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false)
local wc_Tween = tweenS:Create(wc_new, info, goal)
wc_Tween:Play()
wc_Tween.Completed:Connect(function()
wc_Tween:Cancel()
wc_new:Destroy()
end)
wait(0.3)
end
end
if action == "end_charge" then
print(action)
end
end)
