#Tween Animation breaks tool

13 messages · Page 1 of 1 (latest)

analog whale
#
local TweenSettings = TweenInfo.new(0.05)


shootEvent.OnServerEvent:Connect(function(plr,v) -- Needs cooldown or breaks add debounce to animations
    local ammo = 0 -- Assign ammo via server 
    print("ammo is "..ammo)
    
    print(tick())
    for _,Slider in v:GetChildren() do
        local TriggerTween = TweenService:Create(v.Handle.Trigger,TweenSettings,{["C0"] = v.Handle.Trigger.C0 * CFrame.new(math.rad(0.99),0,0)}) -- Trigger back 
        local TriggerTween2 = TweenService:Create(v.Handle.Trigger,TweenSettings,{["C0"] = v.Handle.Trigger.C0 * CFrame.new(0,0,0)})
        local SliderA = Slider.Parent.Handle.Slider -- References slider
        
        
        if Slider.Name == "Slider" then -- Move to bindable event????
            local tween = TweenService:Create(SliderA,TweenSettings, {["C0"] = SliderA.C0 * CFrame.new(-0.5,0,0)})
            local tween2 = TweenService:Create(SliderA,TweenSettings, {["C0"] = SliderA.C0 * CFrame.new(0,0,0)})
            
            
            tween:Play()
            TriggerTween:Play()    
            
            
            
            TriggerTween.Completed:Connect(function() -- After trigger pulls bck it goes back to orig pos
                wait(0.1)
                TriggerTween2:Play()
            end)
            
            tween.Completed:Connect(function() -- After cockback it goes back to orig pos
                wait(0.05)
                tween2:Play()
            end)
        end
    end
    
    
end)
solemn flax
#

u could add a debounce to only the animation?

analog whale
#

I’m just trying to make sure I have no weld issues

solemn flax
#

im not sure idrk that much of animation but that was just a suggestion

#

maybe the physics is broken??

analog whale
#

I'll investigate further, if the debounce doesn't work im going to be seriously frustrated.

solemn flax
#

ok

analog whale
#

@solemn flax alternative solution found, having two sliders and changing the transparency

solemn flax
#

hm

#

well ig that works too lol

#

gfu

magic nimbus
#

@keen apex