I’m trying to do a simple tween betwen cameras and i got an advanced script in a test zone where i dont get an error i copied the same local for the humanoid and in the console says “Humanoid is not a valid member of Model “Workspace.michuchito””
Heres the script i used
--localizacion de recursos
local Jugador = game.Players.LocalPlayer
local Character = Jugador.Character or Jugador.CharacterAdded:Wait()
local humanoid = Character.Humanoid
local GuiDelJugador = Jugador.WaitForChild("PlayerGui")
local TweenS = game:GetService("TweenService")
local TweenI = TweenInfo.new(1)
--localizacion de camaras
local CamaraJugador = game.Workspace.CurrentCamera
local CarpetaCamaras = game.Workspace.Camaras
local Camara1 = CarpetaCamaras.Camara1
local Camara2 = CarpetaCamaras.Camara2
print("Camara")
--localizacion del GUI
--animacion de la intro
local function IntroActivada()
humanoid.WalkSpeed = 0
CamaraJugador.CameraType = Enum.CameraType.Scriptable
CamaraJugador.CFrame = Camara1.CFrame
task.wait(0.5)
local AnimacionCamara1 = TweenS:Create(CamaraJugador,TweenI,{CFrame = Camara2.CFrame})
AnimacionCamara1:Play()
AnimacionCamara1.Completed:Wait()
end
--hacer que la animacion se reproduzca solo cuando el juego este cargado
repeat wait() until game:IsLoaded()
wait(0.5)
IntroActivada()
I can also send the script in the test zone if needed
here is how your folder should look (CFrameValue instances)
here is fully updated script and dont forget uncomment jumppower/height thing to prevent player jumping while cutscene
--localizacion de recursos
local Jugador = game.Players.LocalPlayer
local Character = Jugador.Character or Jugador.CharacterAdded:Wait()
local humanoid = Character:WaitForChild("Humanoid")
local TweenS = game:GetService("TweenService")
local TweenI = TweenInfo.new(1)
--localizacion de camaras
local CamaraJugador = game.Workspace.CurrentCamera
local CarpetaCamaras = game.Workspace.Camaras
print(CarpetaCamaras:GetChildren())
local Camara1 = CarpetaCamaras:WaitForChild("Camera1")
local Camara2 = CarpetaCamaras:WaitForChild("Camera2")
print("Camara")
--localizacion del GUI
--animacion de la intro
local function IntroActivada()
humanoid.WalkSpeed = 0
--humanoid.JumpHeight = 0 uncomment and delete other one if game uses jumpheight
--humanoid.JumpPower = 0 uncomment and delete other one if game uses jumppower
CamaraJugador.CameraType = Enum.CameraType.Scriptable
CamaraJugador.CFrame = Camara1.Value
task.wait(0.5)
local AnimacionCamara1 = TweenS:Create(CamaraJugador,TweenI,{CFrame = Camara2.Value})
AnimacionCamara1:Play()
AnimacionCamara1.Completed:Wait()
end
--hacer que la animacion se reproduzca solo cuando el juego este cargado
repeat task.wait() until game:IsLoaded()
task.wait(0.5)
IntroActivada()
i solved it, idk why but i needed to use :WaitForChild in all the instances
local jugador = game.Players.LocalPlayer
local Character = jugador.Character or jugador.CharacterAdded:Wait()
local humanoid = Character:WaitForChild("Humanoid")
--Datos del TweenService
local TweenS = game:GetService("TweenService")
local TweenI = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
--Localizacion de Camaras/Parts
local CamaraJugador = game.Workspace.CurrentCamera
local Camaras = game.Workspace.Camaras
local Camara1 = Camaras:WaitForChild("Camara1")
local Camara2 = Camaras:WaitForChild("Camara2")
--localizacion del Gui
local BotonPlay = game.StarterGui.IntroGui.Frame:WaitForChild("Play")
local GuiDelJugador = jugador:WaitForChild("PlayerGui")
--animacion de la intro
local function IntroActivada()
humanoid.WalkSpeed = 0
CamaraJugador.CameraType = Enum.CameraType.Scriptable
CamaraJugador.CFrame = Camara1.CFrame
task.wait(0.5)
local AnimacionCamara1 = TweenS:Create(CamaraJugador,TweenI,{CFrame = Camara2.CFrame})
AnimacionCamara1:Play()
AnimacionCamara1.Completed:Wait()
end
--hacer que la animacion se reproduzca solo cuando el juego este cargado
repeat wait() until game:IsLoaded()
wait(0.5)
IntroActivada()