zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 06:59 PM |
| I know how to work with brick trans and such but how do I go about changing the decal tranparency? I know how to use it in a "while true do" but not a onTouch script.. (I'm quite new to scripting..) |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:02 PM |
| Any help would be appreciated.. |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:02 PM |
Basic script -
script.Parent.Touched:connect(function(p) if p.Parent:findFirstChild("Humanoid") then script.Parent.Decal.Transparency = 0.5 wait(5) script.Parent.Decal.Transparency = 0 end end)
Does this help? |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:06 PM |
Yea but I want to understand it but I use EXTREMELY basic scripting still, such as..-
local brick = script.Parent function onTouch(part) brick.Transparency = 1 wait(1) brick.Transparency = 0 end
brick.Touched:connect(onTouch) --Obviously more lines than this and a little more compelx but you understand... |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
| |
|
|
| 31 Oct 2012 07:09 PM |
| What you've put is fine. The if section just detects if it was a player that touched it. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:10 PM |
| Wait so what I did still works? I figured it wouldn't since it reffers to it as brick when it's a decal so I wasn't sure.. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:15 PM |
| I just tested it... It didn't work? I might have done something wrong though (my basic script not yours) |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:15 PM |
It works but it will only set the brick transparency, not the decal transparency. To set the decal transparency, you'd have to put brick.Decal.Transparency = .5
If you've named your decal something else, you'll have to change the word decal above to whatever you've named the decal. You will have to make sure that the brick only has one decal. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:16 PM |
| That is what I was asking about, thank you! I might also test your version.. It's about time I make it a litlle more complex.. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:17 PM |
Also, I put this script in but I think it's CanCollided constantly...
local brick = script.Parent function onTouch(part) brick.CanCollide = false wait(.000005) brick.Cancollide = true end
brick.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:18 PM |
| You're welcome. Sorry if mine doesn't work, that was done while I was half asleep and going on a tablet. X3 |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:20 PM |
| Now you make me feel like a noob if you can do something like that half asleep on a tablet! xD |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:21 PM |
| That will work fine too. You don't need the wait to be like that though. If you're just wanting to make sure it runs properly by putting a wait in, you don't actually need it. If you wanted a timed door, you need the wait to be longer. |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:22 PM |
| I wouldn't say noob. That would be my brother who has no clue on where to begin scripting. XD |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:23 PM |
| It's for like pick a path kind of obby thing, got bored so decided to try scripting something like that. (If you don't know you can make your camera look through non-CanCollided objects and if it is CanCollided your camera can't go through it, whereas my camera goes straight through that path peice.) |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:25 PM |
I use lava. That stops people from using the camera and hat cheats. >=D My lobby randomly picks paths for each player, that means that you can't follow people either. XD |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:26 PM |
| OMG! Teach me your ways! D: |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:28 PM |
| I made that decal thing put in a troll face that slowly fades away (.1 trans per .2 seconds AKA 2 seconds) if you pick the wrong path it will show up. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:29 PM |
| Wait is there a way to script a brick so if it's a non-humanoid object touching it, it CanCollides for like .1 second? :D |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:29 PM |
| I don't think you want to go into it just yet. It uses IntValues and the math.rrandom function. I have saved a copy of it to my models on roblox, it's not public domain though. |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:29 PM |
| Or for it to not be able to pass.. |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:32 PM |
A death script is...
brick = script.Parent onTouch(part) if game.Players:GetPlayerFromCharacter(part.Parent) then part.Parent:BreakJoints() end end |
|
|
| Report Abuse |
|
|
zack785
|
  |
| Joined: 06 Feb 2009 |
| Total Posts: 419 |
|
|
| 31 Oct 2012 07:32 PM |
| If your script does work I suppose I can copy it and then edit the words a little and there you go, it will CanCollide if someone touches it. |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2012 07:33 PM |
Forgot to and this to the bottom...
brick.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|