![]() ![]() If you want it faster or slower, just simply find all the spots where it says “0.65” and change that to however many seconds or milliseconds you want. ![]() That’s the speed it was at in the video at the top. As of right now, the door opens and closes in sixty-five hundredths of a second. You can also customize this script just a tiny bit. TweenService:Create(frame,TweenInfo.new(0.65),):Play() Local tweenService = game:GetService("TweenService")ĬlickDetector.MouseClick:Connect(function() Local opened = model:WaitForChild("Opened") Local Open = model:WaitForChild("DoorOpen") Local Close = model:WaitForChild("DoorClose") Local clickDetector = frame:WaitForChild("ClickDetector") While looking through models, I found a door script with the same concept that worked way than mine, made by a small developer named “abe_o0.” I didn’t want to plagiarize his work so credits to him for giving the better foundations of the script, I had to tweak it so it could work with my door more.ĭouble click on the script, and copy and paste these lines of code into it: ![]() While working on this little tutorial, I started to notice that my script was VERY bad, because it didn’t work 100% of the time, and it wasn’t that smooth. Congratulations (for the third time), you’re done with the building process and now can move on to the script! It should look like this in your explorer tab (without the extra parts that I mentioned earlier): Now you’ll add one more thing to the DoorPart, which is a script. All the properties in the ClickDetector can remain the same. Next, hover your mouse over “DoorPart” and add a ClickDetector to the DoorPart. Rename this value to “Opened” and make sure that “Value” under the properties is off. Next, you’ll hover your mouse over the model, click the plus, and add a BoolValue. ![]() You’re going to add a few more parts into this model and then you’re done with a building, and you’ll move on to scripting. Name that Model whatever you want, I’m just gonna name it Door. Now, you’ll want to hover your mouse over Workspace, click the plus, and add a Model. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |