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

A Basic NPC 'Idle' Animation Script Help?

Asked by 6 years ago
local char = script.Parent --the npc
local hum = char:WaitForChild("Humanoid") --the npc's humanoid
local animation1 = hum:LoadAnimation(script.Animation1) --finds the animation inside the script and loads it in the npc's humanoid
local animation2 = hum:LoadAnimation(script.Animation2)

if char and animation1 and animation2 then --this just checks if the npc exists
    while true do
    animation2:Play() --plays the animation
    wait(4.5)
    animation2:Stop() --stops the animation
    animation1:Play()
    wait(8)
    animation1:Stop()
    animation2:Play()
    wait(4.5)
    animation2:Stop()
    animation1:Play()
    wait(8)
    animation1:Stop()
    end
end

So, I'm trying to make this NPC's only purpose is to be an Idle player for my Custom Character GUI. In Studio, the script above works just fine, however, in online mode/server the figure just stands there with no animate being at all. All recommendatons/suggestions are welcome! Thank you, for your time.

Respectfully,

  • sparkevin
0
Local scripts in NPCs don't work in a online server. If this script is a local script and is inside the NPCs character model, convert it to a server script and it should run fine in a online server. hellmatic 1523 — 6y
0
@sickings It's not a Local script. sparkevin 36 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You must make it Filtering Enabled compatible. Learn about remote events and remote functions here.

Ad

Answer this question