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

Don't know what to do?

Asked by
Valiux 27
7 years ago
Edited by M39a9am3R 7 years ago

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.
0
uh so I kind of used the code blocks wrong... Valiux 27 — 7y
0
Edited, you only need one of those code blocks. You would just need to paste your code in between the ~~~~~~~~~~~ M39a9am3R 3210 — 7y
0
There is very little here that's correct... please review your basics. Perci1 4988 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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

Ad

Answer this question