I'm triying to make an automatic sliding door using Cframe and also that lets detect an Humanoid so it activates, but i don't know how to use Cframe on a script yet can somebody help me?
local running=false function onTouch(hit) if running==false then if hit.Parent:findFirstChild("Humanoid") then running=true for I=1, 100 do script.Parent.CFrame=script.Parent.CFrame+Vector3.new(0.1,0,0) wait() end wait(3) for I=1, 100 do script.Parent.CFrame=script.Parent.CFrame-Vector3.new(0.1,0,0) wait() end running=false end end end script.Parent.Touched:connect(onTouch)
This will move the parent of this script ten studs on the x-axis, and then back again.