Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

trying to make the Animation play randomly when actives but it wont work how do i fix?

Asked by 5 years ago
Edited 5 years ago
local player = game.Players.LocalPlayer 
local mouse = player:GetMouse()
local hum = player.Character.Humanoid
local attack = true
script.Parent.Activated:Connect(function()
local rpick = math.random(0,3)
    local hopethisworks = player.Character.Humanoid:LoadAnimation(script.Parent.Animation1 or script.Parent.Animation2 )  
hopethisworks.Priority = Enum.AnimationPriority.Action 
hopethisworks:Play() 


script.Parent.Handle.Touched:Connect(function(hit)

    local player = game.Players.LocalPlayer

local handle = script.Parent.Handle



local hum = hit.Parent:FindFirstChild("Humanoid")
if hum and attack == true then
    hum:TakeDamage(12)
    attack = false
end


end)
wait(1)
 attack = true
end)

Answer this question