The error code:Humanoid is not a valid member of StarterPlayer “StarterPlayer”
deb = false
script.Parent.Touched:connect(function(part)
if game.Players:FindFirstChild(part.Parent.Name) then
if deb == false then
deb = true
local function shakeCamera(length)
local startTime = tick()
while true do
if tick() - startTime >= length then break end
local x = math.random(-100, 100) / 1000
local y = math.random(-100, 100) / 1000
local z = math.random(-100, 100) / 1000
script.Parent.Parent.Parent.Parent.StarterPlayer.Humanoid.CameraOffset = Vector3.new(x, y, z)
workspace.CurrentCamera.CFrame *= CFrame.Angles(x / 100, y / 100, z / 100)
wait()
end
script.Parent.Parent.Parent.Parent.StarterPlayer.Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end
shakeCamera(150)
print("work")
wait(script.Parent.Parent.TimeToWait.Value)
deb = false
script.Parent.BrickColor = BrickColor.new("Bright green")
end
end
end)