zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 12 Aug 2011 09:41 AM |
pass = script.Parent.Parent.Pass.Value
while true do if pass == false then local Guard = script.Parent:GetChildren() for i=1, #Guard do if Guard[i].ClassName == "Part" then Guard[i].Transparency = 1--invisible guard Guard[i].CanCollide = false--cancollide false end end script.Parent.Name=" "--name end
if pass == true then local Guard = script.Parent:GetChildren() for i=1, #Guard do if Guard[i].ClassName == "Part" then Guard[i].Transparency = 0--visible guard Guard[i].CanCollide = true--cancollide true end end end wait() end
No Output If i run the script with pass set to true it runs like it should but if i then change it to false while its running it doesnt do what it should if its false, i kno wusin a while loop isnt the best way to keep checking buuuut itl do.
Any tips this is drivin me crazy |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:47 AM |
| What is the script's parent? |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 09:38 AM |
| the scripts parent is the model for it to do stuff to that works read my post the problem s there..... |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
| |
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:16 PM |
| ...Wouldn't setting the entire guard's cancollide to false cause it to fall through the floor? |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
| |
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 07:19 PM |
Bad french! C'est anchored le floodcheck est tres anoying! |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:23 PM |
I can't see anything wrong with your code. Try this script and tell me if it works:
script.Parent.Parent.Pass.Changed:connect(function(val) for _, v in pairs(script.Parent:GetChildren()) do if v:IsA("BasePart") then v.CanCollide = val v.Transparency = (val and 0) or 1 end end end) |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 07:24 PM |
| Theres no errors its just a glichy thing trust me ive looked over this 100s of times and cannot understand why it wont work |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
| |
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 07:28 PM |
| Ill do your test and BEFORE SOMEONE SAYS THIS I KNOW TS NOT AS COMPACT AS IT COULD BE I changed it alost to make it simpler to help debug it also to ensure it ran properly so i didnt have to worry about me using the right meathods ontop of everything else |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
| |
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:33 PM |
Any output on my script?
Floodcheck2 |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 07:49 PM |
| nope just some from some other script that has noooothing to do with it |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:50 PM |
| What exactly happens when the value changes? Just nothing? |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 08:11 PM |
| If i run with value already set to true it will run the code thats meant to run when its set to true but if i change it after ive already clicked play it just carries on running as if it were true and dosent register the change.... |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 08:28 PM |
Oh. "pass = script.Parent.Parent.Pass.Value"
What you're doing in that line is copying the value of Pass into pass, not linking it to the value of pass. To do what you want, you need to do this:
pass = script.Parent.Parent.Pass
And then index it later as pass.Value
I have no idea why I didn't spot that sooner. |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2011 08:33 PM |
| lol I can't believe that one took everyone so long. -.- First thing I saw. Ha ha :P |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 08:36 PM |
oooooK
thanks i shall test, And if it was first thing you saw why didnt you say...???? |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 08:36 PM |
| And usually I'm so good at that to. :/ |
|
|
| Report Abuse |
|
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 13 Aug 2011 08:41 PM |
| HA HA HA!!!! THANK YOU GUYS IT WORKS, I HAVE LEARNED SOMETHING AND THANK YOU ALL FOR YOUR HELP!!! |
|
|
| Report Abuse |
|
|