Hi! I’m making a cutscene and I need your character to walk to certain spots for it. There are 2 scripts. The prints work, but nothing happens.
Edit: There are also no errors.
Server Script
game.ReplicatedStorage.PathfindEvent.OnServerEvent:Connect(function(Player,destination)
print("a")
-- Variables
local humanoid = Player.Character.Humanoid
local body = Player.Character:FindFirstChild("HumanoidRootPart") or Player.Character:FindFirstChild("Torso")
local pathfindingService = game:GetService("PathfindingService")
-- Create Path Instance
local path = pathfindingService:CreatePath()
-- Make a Path
path:ComputeAsync(body.Position, destination.Position)
-- Get Waypoints
local waypoints = path:GetWaypoints()
-- Move to all waypoints
for k, waypoint in pairs(waypoints) do
humanoid:MoveTo(waypoint.Position)
-- Let Humanoid Jump if Needed
if waypoint.Action == Enum.PathWaypointAction.Jump then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
humanoid.MoveToFinished:Wait()
print("b")
end
end)
Local Script
game.Workspace.CutsceneHitbox.Touched:Connect(function(Hit)
if game:GetService("CollectionService"):HasTag(Hit.Parent,"InCutscene") then
return
end
if Hit.Parent == game.Players.LocalPlayer.Character then
game:GetService("CollectionService"):AddTag(Hit.Parent,"InCutscene")
local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Papyrus = game.Lighting.Papyrus or game.Workspace.Papyrus
Player.Character.Humanoid.JumpPower = 0
Player.Character.Humanoid.WalkSpeed = 0
Camera.CameraType = Enum.CameraType.Scriptable
game:GetService("TweenService"):Create(Camera,TweenInfo.new(
1,
Enum.EasingStyle.Circular,
Enum.EasingDirection.Out,
0,
false,
0
),{
CFrame = game.Workspace.CutsceneCameraBehindPillar.CFrame
}):Play()
game.ReplicatedStorage.MovementEvent:FireServer("Disable")
wait(2)
Papyrus.Parent = game.Workspace
game.Workspace["Judgement Hall"].Wall2.WindowToRemove.Parent = game.Lighting
game:GetService("TweenService"):Create(Camera,TweenInfo.new(
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
),{
CFrame = game.Workspace.CutsceneCameraPapyrus.CFrame
}):Play()
game.ReplicatedStorage.PathfindEvent:FireServer(game.Workspace.PapyrusCutsceneMoveToZone)
wait(1.5)
local ChatService = game:GetService("Chat")
ChatService:Chat(Papyrus.Head,"heya.")
wait(3)
ChatService:Chat(Papyrus.Head,"so, you've been busy, huh?")
else
return
end
end)
Edit: Showed the full Local Script
Edit: There’s also a custom StarterCharacter rig. StarterCharacter.rbxm (31.6 KB)