Bassicly i want to be able to detect if a players Z axis is not valid to game.Workspace:FindFirstChild(“Lane”…lane)
The ‘lane’ variable is a number
I want the humanoidrootpart to get detected whenever its Z axis is invalid to the lane
Heres The Current part of the script:
game["Run Service"].RenderStepped:Connect(function()
if moving == false then
if char:WaitForChild("HumanoidRootPart").CFrame ~= CFrame.new(char.HumanoidRootPart.CFrame.X, char.HumanoidRootPart.CFrame.Y, game.Workspace.Game:FindFirstChild("Lane"..lane).CFrame.Z) then
end
end
end)
I only need help with the “if char:WaitForChild()” part but if possible fill in the rest -
Okay, but what do you mean “not valid”? All positional values are valid, do you mean if the Z axis does not equal a particular value, in this case the lane?
Do you want it to be exact or have some leeway? Hint: If it’s an exact check, the character will pretty much never be aligned with the lane according to the script.