Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Don't know what to do?

So basically I'm trying to make a sliding door that when you touch it it decreases .1 studs every .1 second, or even smoother.

local a = game.Workspace.DoorEntrance.DL
local b = game.Workspace.DoorEntrance.DR

function OpenDoor(Slide)
		a.Vector3.Size = 
		b.Vector3.Size = 
	script.Parent.Touched:connect(onTouch)
end
--unfinished.

3 comments

0

uh so I kind of used the code blocks wrong...

0

Edited, you only need one of those code blocks. You would just need to paste your code in between the ~~~~~~~~~~~

0

There is very little here that's correct... please review your basics.

1 answer

A few things here buddy! c;

  1. It's a.Size and b.Size. Also, you're not even changing the sizes of the doors.
  2. You have to put the event AFTER the function, not inside it.
  3. You don't need the parameter of "Slide" in the function since you're not even referring to it.
  4. You're not even connecting any functions to the Touched event, there is no "OnTouch" function
local a = game.Workspace.DoorEntrance.DL
local b = game.Workspace.DoorEntrance.DR
local parent = script.Parent --You don't have to add a variable for script.Parent, just how I script is all

function OpenDoor()
        a.Size = Vector3.new(0,0,0) --Change this 0,0,0 to whatever you want
        b.Size = Vector3.new(0,0,0) --Change this 0,0,0 to whatever you want
end

parent.Touched:connect(OpenDoor)

If this works out for you, don't forget to upvote this answer, we both get rep! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.