One Way Shields: Difference between revisions

From Goodblox Wiki
Jump to navigationJump to search
(Created page with "{{CatUp|Tutorials}} __TOC__ == Introduction == One-Way shields are a door or shield that only lets people through one way. This can fix spawnkilling problems, for example,...")
 
mNo edit summary
 
Line 8: Line 8:
== Building ==
== Building ==


First, open up [[Goodblox_Studio|Goodblox Studio]].  Create a wall.  I will use a spawn room, for example.
First, open up [[GoodBlox Studio]].  Create a wall.  I will use a spawn room, for example.


[[Image:Rob1.gif|300px]]   
[[Image:Rob1.gif|300px]]   

Latest revision as of 03:19, 28 September 2021

Introduction

One-Way shields are a door or shield that only lets people through one way. This can fix spawnkilling problems, for example, by placing weapons/weapon givers outside the spawnroom, and spawns inside and having this shield in-between. This makes it only possible to exit to the weapons, but not to reenter with weapons. Therefore, NO Spawnkilling.

Building

First, open up GoodBlox Studio. Create a wall. I will use a spawn room, for example.

Next is the shield. Create a brick. Color, transparency and reflectance do not matter. We will have to fill from the bottom and to the top. I recommend for it to be two studs thick and it to be anchored. Note that if your brick is only 1 stud thick, it will be possible to open it from both sides.:

Note that there are two more studs in front of where we just placed a shield, so that we can place another brick (of the same size). Anchor this one, too. (Look near the ground where the building stands).


The rest you decide:

Name the bricks Door And Door2 , and group those two bricks.

Scripting

Select the brick that is supposed to open when you touch it. Click Insert, Object, then select Script.


300

Go to scripting mode for that script you just inserted by selecting that script and double-clicking on it.

Here's the script you'll have to insert:

door = script.Parent.Parent.Door
door2 = script.Parent.Parent.Door2
function onTouched(hit)
	door.CanCollide = false
	door2.CanCollide = false
	wait(3)
	door.CanCollide = true
	door2.CanCollide = true
end

script.Parent.Touched:connect(onTouched)