One Way Shields

From Goodblox Wiki
Revision as of 20:45, 23 June 2020 by Pizzaboxer (talk | contribs) (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,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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)