‘’’ if not game:IsLoaded() then
game.Loaded:Wait()
end
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:Wait()
local Cameras = workspace:WaitForChild(“Cameras”)
local rs = game:GetService(“ReplicatedStorage”)
local Animations = rs:WaitForChild(“Animations”)
plr.PlayerGui:WaitForChild(“Loading”).Enabled = true
print(“started”)
local cam = workspace.CurrentCamera
local she1ls = rs:WaitForChild(“she1ls”):Clone()
local appearance = char:WaitForChild(“Humanoid”):GetAppliedDescription()
appearance.Face = 520788950
local PlayerService = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = PlayerService.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local PlayerGui = Player:WaitForChild("PlayerGui")
local Humanoid = Character:WaitForChild("Humanoid")
local CurrentCamera = game.Workspace.CurrentCamera
local LoadingGui = PlayerGui:WaitForChild("Loading")
local CameraFolder = workspace:WaitForChild("Cameras")
local AnimationFolder = ReplicatedStorage:WaitForChild("Animations")
local She1ls = ReplicatedStorage:WaitForChild("she1ls")
local Appearance = Humanoid:GetAppliedDescription()
local function StartGame()
local NewShe1ls = She1ls:Clone()
local She1lsHumanoid = NewShe1ls:WaitForChild("Humanoid")
local She1lsAnimator = She1lsHumanoid and She1lsHumanoid:WaitForChild("Animator")
local SleepingAnim = AnimationFolder:WaitForChild("Sleeping")
local Cam1 = CameraFolder:WaitForChild("Cam1")
local SleepingTrack = She1lsAnimator and She1lsAnimator:LoadAnimation(SleepingAnim)
LoadingGui.Enabled = false
NewShe1ls.Parent = workspace
She1lsHumanoid:ApplyDescriptionReset(Appearance)
CurrentCamera.CameraType = Enum.CameraType.Scriptable
CurrentCamera.CFrame = Cam1.CFrame
SleepingTrack.Looped = true
SleepingTrack:Play()
end
LoadingGui.Enabled = true
Appearance.Face = 520788950
game.Loaded:Connect(StartGame)
I fixed it now, I think it had to do with the rig being created locally because when I stopped it from beiing created locally it started working, but now i’ve got another issue, the run animation isn’t playing:
local plr = game.Players.LocalPlayer
local Cameras = workspace:WaitForChild("Cameras")
local rs = game:GetService("ReplicatedStorage")
local Animations = rs:WaitForChild("Animations")
plr.PlayerGui:WaitForChild("Loading").Enabled = true
print("started")
local cam = workspace.CurrentCamera
local char = plr.Character
local BuffGuy = rs:WaitForChild("BuffGuy")
local pathFindingService = game:GetService("PathfindingService")
local Rig = rs:WaitForChild("Rig"):Clone()
local appearance = char:WaitForChild("Humanoid"):GetAppliedDescription()
appearance.Face = 520788950
script.Loaded.Event:Connect(function()
plr.PlayerGui:WaitForChild("Loading").Enabled = false
end)
Rig.Parent = workspace
Rig.Humanoid:ApplyDescriptionReset(appearance)
Rig.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = Cameras:WaitForChild("Cam1").CFrame
print("successful")
local sleepingAnim = Rig.Humanoid.Animator:LoadAnimation(Animations.Sleeping)
sleepingAnim.Looped = true
sleepingAnim:Play()
task.wait()
script.Loaded:Fire()
local BuffGuyClone = BuffGuy
BuffGuyClone.Parent = workspace
task.wait(1)
local path = pathFindingService:CreatePath({
AgentRadius = 2,
AgentHeight = 5,
AgentCanJump = true
})
path:ComputeAsync(BuffGuy.HumanoidRootPart.Position, Rig.HumanoidRootPart.Position)
local walkAnim = Rig.Humanoid.Animator:LoadAnimation(Animations.RunAnim)
walkAnim.Looped = true
Rig.Humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Running then
walkAnim:Play()
end
end)
for i,v in path:GetWaypoints() do
print(#path:GetWaypoints())
BuffGuy.Humanoid:MoveTo(v.Position)
BuffGuy.Humanoid.MoveToFinished:Wait()
end
for i = 1,5 do
BuffGuy.Humanoid.Jump = true
task.wait(0.6)
end