#Can't Figure out why my script doesn't work for mobile users

23 messages · Page 1 of 1 (latest)

opaque scarab
#

The damage works fine but the animation doesn't for mobile users

Btw this is a script for a Sword
``​lua
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local debounce = false
local canDamage = false
local cooldownLength = 0.5

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://13316989854"

script.Parent.Activated:Connect(function()

if debounce == false then
    
    debounce = true
    
    canDamage = true
    
    character.Humanoid:LoadAnimation(animation):Play()
    
    wait(cooldownLength)
    
    debounce = false

end

end)

script.Parent:WaitForChild("Handle"):WaitForChild("Blade").Touched:Connect(function(hit)
if canDamage == false then return end

local humanoid = hit.Parent:FindFirstChild("Humanoid")

if canDamage == true then
    canDamage = false
    humanoid:TakeDamage(10)
end

end)
``

#

Can't Figure out why my script doesn't work for mobile users

topaz orbit
#

No idea

tired phoenix
#

do you use a different account on your phone?

opaque scarab
#

No

#

and i tested it with other accounts

tired phoenix
#

and it works everywhere except on phone???

opaque scarab
#

Yes

#

the damage works

#

but not the animation

toxic ruin
brittle gorge
#

mostly because your game is still private?

#
opaque scarab
eager kelpBOT
#

studio** You are now Level 1! **studio

opaque scarab
#

its works fine with Pc

#

but not for mobile

toxic ruin
# opaque scarab yes

The animation might've been published to Your account. Make sure it's published to the Group that the game is published on

opaque scarab
#

I am going to check that

opaque scarab
#

but now i changed that

#

and it works'