alexslime
|
  |
| Joined: 11 Sep 2010 |
| Total Posts: 63 |
|
|
| 20 Dec 2015 09:04 AM |
-----Brick-Boom-script-----
local head = script.Parent local sound = head:findFirstChild("Boom") local toggle = false
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then if toggle == false then toggle = true wait() sound:Play() end end end
script.Parent.Touched:connect(onTouched)
Script for the trigger
local dir = script.Parent.Parent.Parent.Debre -- Where the bricks are stored. local AName = "ShowUp" -- Name of the brick that will appear. local DName = "GoAway" -- Name of the bricks that will disappear. local set = false function onTouch(part) if set == false then if part.Parent:FindFirstChild("Humanoid") ~= nil then set = true local items = dir:GetChildren() for i,k in pairs(items) do if k.Name == AName then k.Transparency = 0 k.CanCollide = true end if k.Name == DName then k.Transparency = 1 k.CanCollide = false end end end script.Parent.Smoke.Enabled = true wait(2) script.Parent.Smoke.Enabled = false end end
script.Parent.Touched:connect(onTouch)
SIDE NOTE: MAKE A MODEL CALLED "Debre" and put it under a "Model" name the model "Glass" Also add a ThumbnailCamera before "Debre"! |
|
|
| Report Abuse |
|
|
| |
|
Xarean
|
  |
| Joined: 26 Feb 2015 |
| Total Posts: 2190 |
|
| |
|
| |
|
eiad999
|
  |
| Joined: 27 Mar 2013 |
| Total Posts: 210 |
|
|
| 22 Dec 2015 11:51 AM |
| Some scripting mistakes, the script could be much simpler, unneeded lines. |
|
|
| Report Abuse |
|
|