You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
For buttons to continue working after player respawns.
What is the issue? Include screenshots / videos if possible!
After player respawns, I get the following error upon button click Cannot load the AnimationClipProvider Service. - Client - Mobile:16
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried applying similar codes from other working buttons but have failed.
I would like to point out, this is a big issue within the game. I would be more than happy to provide a payout if someone helps me solve issue.
Thanks in advance for your help!
script under button
local Event = game.ReplicatedStorage:WaitForChild("dofacENC")
local Cool = false
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
---- Animation
Animation = game.Lighting.Anim.dofac
---- Cooldown
local Cooldown = 10
script.Parent.MouseButton1Click:Connect(function()
if Cool == false then
Cool = true
Event:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
Cool = true
Event:FireServer()
-- timer part starts here add after fireserver event
for i = Cooldown,1,-1 do --Loop counting down from 15 to 1 (CHANGE "cooldown to a number unless using a local function")
script.Parent.Text = i --Display the number of the loop
wait(1) --Wait 1 second before the next iteration
script.Parent.Text = script.Parent.Name
end -- timer part ends here
wait(0.5)
--plr.PlayerGui.Quirk.skill.C.Text = "C"
Cool = false
end
end)
just do Player.CharacterAdded:Connect(function()
and rerun the script
)
local Event = game.ReplicatedStorage:WaitForChild("dofacENC")
local Cool = false
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
---- Animation
Animation = game.Lighting.Anim.dofac
---- Cooldown
local Cooldown = 10
plr.CharacterAdded:Connect(function(character)
script.Parent.MouseButton1Click:Connect(function()
if Cool == false then
Cool = true
Event:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
Cool = true
Event:FireServer()
-- timer part starts here add after fireserver event
for i = Cooldown,1,-1 do --Loop counting down from 15 to 1 (CHANGE "cooldown to a number unless using a local function")
script.Parent.Text = i --Display the number of the loop
task.wait(1) --Wait 1 second before the next iteration
script.Parent.Text = script.Parent.Name
end -- timer part ends here
task.wait(0.5)
--plr.PlayerGui.Quirk.skill.C.Text = "C"
Cool = false
end
end)
end)
When you respawn, please check whether the script is disabled. If it is not disabled, then add printings:
script.Parent.MouseButton1Click:Connect(function()
print("clicked")
if Cool == false then
print("functional")
Cool = true
Event:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
Cool = true
Event:FireServer()
-- timer part starts here add after fireserver event
for i = Cooldown,1,-1 do --Loop counting down from 15 to 1 (CHANGE "cooldown to a number unless using a local function")
script.Parent.Text = i --Display the number of the loop
wait(1) --Wait 1 second before the next iteration
script.Parent.Text = script.Parent.Name
end -- timer part ends here
wait(0.5)
--plr.PlayerGui.Quirk.skill.C.Text = "C"
Cool = false
end
end)
If it prints “clicked” but not “functional”, then probably there is something which is affecting the script or the debounce isn’t working. Always do debugging/fixing with printings, it is helpful!
script.Parent.MouseButton1Click:Connect(function()
print("clicked")
print(Cool)
if Cool == false then
print("functional")
Cool = true
Event:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
Cool = true
Event:FireServer()
-- timer part starts here add after fireserver event
for i = Cooldown,1,-1 do --Loop counting down from 15 to 1 (CHANGE "cooldown to a number unless using a local function")
script.Parent.Text = i --Display the number of the loop
wait(1) --Wait 1 second before the next iteration
script.Parent.Text = script.Parent.Name
end -- timer part ends here
wait(0.5)
--plr.PlayerGui.Quirk.skill.C.Text = "C"
Cool = false
else
print(Cool)
end
end)
I would like to point out that the keycode (in this case “C” on Keyboard) always works fine. its the screen button that stops functioning. Would context action service work somehow?