Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hello does anyone have experience reading lookVectors? My script does not work

Asked by 7 years ago

I currently have this script

currentowner = script.Parent.Parent.CurrentOwner
teleportposition = script.Parent.Parent:FindFirstChild("teleport").CFrame
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if hit.Parent.Name == currentowner.Value or hit.Parent.Parent.Name == currentowner.Value  then
            print("im logic")
            --hit.Parent.HumanoidRootPart.CFrame = teleportposition
            --if hit.Parent.HumanoidRootPart.CFrame.lookVector >= CFrame.new(0,0,0) then
            --  hit.Parent.HumanoidRootPart.CFrame = teleportposition
            --end
            print(hit.Parent.HumanoidRootPart.CFrame.lookVector)
        end     
    end
end)
-- Errors
11:34:39.321 - Workspace.house.door.entryscript:7: attempt to compare two userdata values

https://gyazo.com/f477fb43908be6bae3f75dc176b477bc Here is a GIF from testing it. Help would me very much appreciated :).

0
I'm pretty sure all you have to do is add an body velocity and maybe a body gyro. Test them out. Because usually you use lookVector for velocity's and gyros and stuff like that. LennonLight 95 — 7y
0
I want a door that just stays the same like an anchored part. It's intend is for a tycoon. Thanks for your help though i appreciate it :) Ernie252 -4 — 6y

Answer this question