Some animations I have won't load. This is an example of an animation. I put it in the StarterGear and it's supposed to give you 2 money every time it plays-- the error isn't in that part, since I removed the adding money part and it still didn't load.
I even tried adding a wait-- still the same problem.
A LocalScript inside the animation:
repeat wait() until game.Players.LocalPlayer.Character ~= nil
local moneyModule = require(game:GetService("ReplicatedStorage").Modules:WaitForChild("addMoneyModule"))
anim = script.Parent.Animation
tool = script.Parent
p = tool.Parent.Parent
mouse = p:GetMouse()
c = p.Character
LoadAnim = c.Humanoid:LoadAnimation(anim)
debounce = false
CoolDown = 0
function PlayAnim()
LoadAnim:Play()
wait(CoolDown)
moneyModule.addMoney(script.Parent.addMoneyAmount, game.Players.LocalPlayer)
debounce = false
end
function OnSelect(mouse)
mouse.Button1Down:connect(function()
if debounce == false then
debounce = true
PlayAnim()
end
end)
end
tool.Selected:connect(OnSelect)

13 comments
You can't access the ServerScriptService from a local script.
So how should I access it? Should I just move the modulescript to replicatedstorage?
Alright, I moved it to ReplicatedStorage & it's still not loading.
Yes that would be the best place for it, though requiring a ModuleScript from the client, in my experience, only executes the ModuleScript on the client. I think you would have to call the server via RemoteEvent and then have the server execute it.
So I'd FireServer? (New to FE). Also, that doesn't fix the animation loading even if it does fix the money being added.
You would need to have the server play the animation aswell, and yes you would Fire the server, here's a helpful link: https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events
Would I have to change all the variables accessing the Player (game.Players.LocalPlayer)?
did you make the animations for R6 or R15?
r6 ^
well that's the error i think
if its r6, you need to make sure your players are r6 too (same goes for r16) ~ i think
I switched it and it still says failed to load
did you make it so characters load in as r6 when they join the game? if you did and it didn't work, then idk :/