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

I Am Making This Western Game And I Am Trying To Make A Cell Door Open?

Asked by 6 years ago

So As You Can Tell By The Question.I Am Making A Western Game And If A Sheriff Catches A Theif Or Whatever Then The Sheriff Arrests Them And Tells Them To Come To The Cell.So I Want To make It Simple Instead Of Someone Having To Click It To Open (May Change That) So i Put Can Collide To False And Transparency To 4,But When I Test The Game,The Door Goes Transparent But Doesn't Let Me Walk Into The Cell which Is Meant To Happen When canCollide Is false.

Here It Is:

while true do
    wait(2)
    game.Workspace["Cell Door"].Transparency = 4
    wait(3)
    game.Workspace["Cell Door"].Transparency = 0
    wait(2)
    canCollide = false
    wait(2)
    canCollide = true
    wait(2)
end

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

In your script, canCollide just acts as a variable as you do not specify it as the property of the door. Instead, similarly to how you did it with the transparency, you should do:

workspace["Cell Door"].CanCollide = false

and the same for setting it to true again.

0
Thanks Man.It Works.Maybe I Need To Start Using Brackets And That In My Scripts Now.XD Anyways Again.It Works And THANK YOU! RoccoAttackYT 8 — 6y
Ad

Answer this question