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

Animations I have won't load when game starts (UNANSWERED PLEASE HELP)?

Asked by
Vid_eo 126
5 years ago
Edited 5 years ago

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)
2
You can't access the ServerScriptService from a local script. jackfrost178 242 — 5y
0
So how should I access it? Should I just move the modulescript to replicatedstorage? Vid_eo 126 — 5y
0
Alright, I moved it to ReplicatedStorage & it's still not loading. Vid_eo 126 — 5y
0
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. jackfrost178 242 — 5y
View all comments (9 more)
0
So I'd FireServer? (New to FE). Also, that doesn't fix the animation loading even if it does fix the money being added. Vid_eo 126 — 5y
0
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 jackfrost178 242 — 5y
0
Would I have to change all the variables accessing the Player (game.Players.LocalPlayer)? Vid_eo 126 — 5y
0
did you make the animations for R6 or R15? cruizer_snowman 117 — 5y
0
r6 ^ Vid_eo 126 — 5y
0
well that's the error i think Vid_eo 126 — 5y
0
if its r6, you need to make sure your players are r6 too (same goes for r16) ~ i think cruizer_snowman 117 — 5y
0
I switched it and it still says failed to load Vid_eo 126 — 5y
0
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 :/ cruizer_snowman 117 — 5y

Answer this question