This script works perfectly fine on one client, but when I test multiple, it doesn’t work on only the second client. Any ideas as to why?
local player = game.Players.LocalPlayer
local seatAnim = Instance.new("Animation")
seatAnim.Name = "SittingAnim"
seatAnim.AnimationId = "http://www.roblox.com/asset/id?=10558874416"
local loadSeatAnim = player.Character.Humanoid.Animator:LoadAnimation(seatAnim)
player.Character.Humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Seated then
loadSeatAnim:Play()
elseif new ~= Enum.HumanoidStateType.Seated then
loadSeatAnim:Stop()
end
end)
That’s false, you can load and play animations even on the Client, the possibility of it is maybe something to do with the character, or when they load.
Hm that is indeed interesting, I’m unsure, because far as I can tell you’re trying to load an animation into the Humanoid of the Client, and which is perfectly fine, nothing seems wrong far as I see it. Hm, however try loading it from the humanoid instead of the Animator, see if that does anything.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local seatAnim = Instance.new("Animation")
seatAnim.Name = "SittingAnim"
seatAnim.AnimationId = "http://www.roblox.com/asset/id?=10558874416"
local loadSeatAnim = animator:LoadAnimation(seatAnim)
humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Seated then
loadSeatAnim:Play()
elseif new ~= Enum.HumanoidStateType.Seated then
loadSeatAnim:Stop()
end
end)
i wonder if it’s just a studio issue since the client that was focused worked while the unfocused client doesn’t work.
if that’s the case, then i shouldn’t need to worry, since every game client will be focused.