So I want like a bar to fill when I charge my attack so like I made this script here(this is only a part of a script)
uis.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.Three and not debounce then
debounce = true
canrun = false
hum.WalkSpeed = 0
game.ReplicatedStorage.RE.Sprint:FireServer("End")
local chargeanim = hum.Animator:LoadAnimation(rs.Fx.Animation2)
chargeanim:Play()
Bar.Size = UDim2.new({0, 0},{0, 0})
Bar.Parent.Visible = true
Bar:TweenSize(UDim2.new({0, 270},{1, 0}),
Enum.EasingDirection.In,
Enum.EasingStyle.Sine,
5
)
hum.JumpHeight = 0
charging = true
local data = {
character = character,
action = "Charge"
}
re:FireServer(data)
local mod = MOD
repeat
task.wait(.1)
mod += .04
until charging == false or mod > MAXMOD or hum.Health <= 0
if hum.Health <= 0 then return end
chargeanim:Stop()
Bar.Parent.Visible = false
wait(0.2)
hum.Animator:LoadAnimation(rs.Fx.Animation):Play()
wait(.6)
camShake:ShakeOnce(2, 5, .2, .4)
data = nil
data = {
character = character,
action = "Release",
CFrame = character.HumanoidRootPart.CFrame,
charge = mod,
}
effect(data.CFrame, mod)
re:FireServer(data)
data= nil
end
end)
but like the tween doesnt plays..