so basically i have this cutscene of the player walking in to their house and whenever the player interacts with the hitbox it doesnt activate (THIS IS ONLY 1 PART OF IT)
local char = player.Character or player.CharacterAdded:Wait()
local camera = game.Workspace.CurrentCamera
local camfolder = game.Workspace:WaitForChild("Cams2")
local tweenService = game:GetService("TweenService")
-- Get all required parts
local hit = camfolder:FindFirstChild("Hitbox2")
local playerpos = camfolder:FindFirstChild("PlayerPosition2")
local camera1 = camfolder:FindFirstChild("camera1")
local camera2 = camfolder:FindFirstChild("camera2")
local door = workspace:FindFirstChild("Door")
if not (hit and playerpos and camera1 and camera2 and door) then
warn("Missing one or more required objects in Workspace or Cams2.")
return
end
local played = false
-- Create camera tween
local camTween = tweenService:Create(camera, TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
CFrame = camera2.CFrame
})
hit.Touched:Connect(function(otherPart)
if played then return end
local character = otherPart:FindFirstAncestorOfClass("Model")
if character and character:FindFirstChild("Humanoid") and character == player.Character then
print("Cutscene triggered")
played = true
local humanoid = char:FindFirstChildOfClass("Humanoid")
local root = char:FindFirstChild("HumanoidRootPart")
-- Freeze movement
if humanoid then
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
end
-- Open the door (make invisible/non-collide)
door.Transparency = 1
door.CanCollide = false
-- Set up cutscene camera
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = camera1.CFrame
-- Move player to start of cutscene
if root then
root.CFrame = playerpos.CFrame
end
```
** You are now Level 6! **