Humanoid not being detected in StarterGUI (or playergui)

I am trying to have an emote play when you click a box, but when you first open the game, the output says

  10:38:45.009  Stack Begin  -  Studio
  10:38:45.009  Script 'Players.omotashi.PlayerGui.Emotes.Frame.KatKick.KatKickEmote', Line 6  -  Studio - KatKickEmote:6
  10:38:45.009  Stack End  -  Studio
  10:38:45.009  Humanoid is not a valid member of Model "Workspace.omotashi"  -  Client - DDEmote:7
  10:38:45.009  Stack Begin  -  Studio
  10:38:45.009  Script 'Players.omotashi.PlayerGui.Emotes.Frame.Default.DDEmote', Line 7  -  Studio - DDEmote:7
  10:38:45.009  Stack End  -  Studio
  10:38:45.010  Humanoid is not a valid member of Model "Workspace.omotashi"  -  Client - MannEmote:6
  10:38:45.010  Stack Begin  -  Studio
  10:38:45.010  Script 'Players.omotashi.PlayerGui.Emotes.Frame.MannRobics.MannEmote', Line 6  -  Studio - MannEmote:6
  10:38:45.010  Stack End  -  Studio

I have even tried to add waiting for humanoid to load in but it still does this no matter what

All my Emote scripts have the same template as below

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Anim = Instance.new('Animation')
Anim.AnimationId = ANIMATION ID
local PlayAnim = Character.Humanoid:LoadAnimation(Anim)
local song = game.Workspace.Music.MUSICNAME
local DancingVal = script.Parent.Parent.Dance
DancingVal = false
local UI = script.Parent

UI.MouseButton1Click:Connect(function()
	if DancingVal == false then
		DancingVal = true
		Character.HumanoidRootPart.Anchored = true

		PlayAnim:Play()
		song.Parent.MainArea.Volume = 0
		song:Play()
		PlayAnim.Stopped:Wait()
		Character.HumanoidRootPart.Anchored = false
		song.Parent.MainArea.Volume = 0.5
		DancingVal = false
	end
end)
--some variables are taken out to have privacy

Any help is fantastic!!

I’ve ran into this stuff alot but everytime you make a variable about .Character.something you gotta use Character:WaitForChild(“something”). I don’t know why this happens but i guess it has something to do with the Character to be the Model.

local Hum = Character:WaitForChild(“Humanoid”)
local PlayAnim = Hum:LoadAnimation(Anim)

That fixed it, but now my box isnt showing up anymore. (I also fixed a big issue of not doing Var.Value)

This is the script:


local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local DancingVal = script.Parent.Dance

UIS.InputBegan:connect(function(input) 
	if input.KeyCode == Enum.KeyCode.LeftAlt and DancingVal.Value == false then
		Player.PlayerGui.Emotes.Enabled = true
		print("open")
		
	end
end)

After (alot) of Trial and Error, I figured it out to be that scripts dont run when the parent ScreenGUI is disabled. Thanks for your help!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.