#what is wrong with this code? whenever i try to run it it says this ------------->

25 messages · Page 1 of 1 (latest)

dawn garden
#

local function open()
print("open")
repeat
part.Position.Z = part.Position.Z + 0.01
wait(0.05)
until part.Position.Z > 25
end

tiny loom
#

pretty sure X Y Z are read-only

#

you cant change them

dawn garden
#

oh

thin palmBOT
#

studio** You are now Level 2! **studio

tiny loom
#

u gotta use .Position = Vector3.new(0,0,0)

#

if you want to add only z then use like

#

.Position += Vector3.New(0,0,1)

dawn garden
#

thanks man

#

i was confused why it wasnt working

#

lol

#

wait

#

how do i only change 1

#

like just the Y or X

tiny loom
#

keep them at 0

dawn garden
#

i mean only edit one using a variable

#

im trying to do a repeat script to slowly open a door

tiny loom
#

use += instead of just =

#

then it adds that value to the position

#

3,4,2 + 0,0,1 becomes 3,4,3

dawn garden
#

thanks man

#

have a good day

#

local part = script.Parent
local function open()
print("open")
repeat
part.Position += Vector3.new(0,0.01,0)
wait(0.1)
until part.Position.Y > 25
end

script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChildWhichIsA("Humanoid") then
print("touched by humanoid")

    open()
end

end)

it works now epic

tiny loom
#

tbh u could just use tweens instead to make it simpler