generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Goin crazy at this been tryin to fix for ages now.

Previous Thread :: Next Thread 
zazw3 is not online. 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
JiggedyJam is not online. JiggedyJam
Joined: 01 Apr 2010
Total Posts: 4611
12 Aug 2011 09:47 AM
What is the script's parent?
Report Abuse
zazw3 is not online. 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 is not online. zazw3
Joined: 05 Jul 2008
Total Posts: 1238
13 Aug 2011 06:57 PM
..Someone?
Report Abuse
swmaniac is not online. 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 is not online. zazw3
Joined: 05 Jul 2008
Total Posts: 1238
13 Aug 2011 07:18 PM
c'etait anchored
Report Abuse
zazw3 is not online. 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 is not online. 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 is not online. 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 is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
13 Aug 2011 07:26 PM
Did you try my script?
Report Abuse
zazw3 is not online. 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 is not online. zazw3
Joined: 05 Jul 2008
Total Posts: 1238
13 Aug 2011 07:31 PM
No joy...
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
13 Aug 2011 07:33 PM
Any output on my script?

Floodcheck2
Report Abuse
zazw3 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Greendolph is not online. Greendolph
Joined: 07 May 2008
Total Posts: 2543
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image