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: Script not working; please help :)

Previous Thread :: Next Thread 
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
30 Nov 2011 12:58 PM
Okay, so I'm making this super awesome card/pass/hand/sensor door
And I have a hand sensor that I made
Here's the first script:

Activate = script.Parent.Activator

local users = {"rossb654mail","Player"} --you can add more player's here

function onTouched(hit)
    for _, username in ipairs(users) do
        if hit.Parent.Name:lower() == username:lower() then

    Activate.Disabled = false
    wait(0.01)
    Activate.Disabled = true
            
            
        end
    end
end

script.Parent.Touched:connect(onTouched)

Now, you're probably thinking "Hmm? what is Activate?" Well, that is another script. I activate other scripts to test that it works, then I merge into one.
Here's the other script:

light = script.Parent.Parent.Light
door = script.Parent.Parent.Door
sensor = script.Parent

            script.Parent.Script.Disabled = true
            light.BrickColor = BrickColor.new(1009)
            sensor.BrickColor = BrickColor.new(1009)
            wait(1)
            light.BrickColor = BrickColor.new(1020)
            sensor.BrickColor = BrickColor.new(1020)
            for i = 1, 30 do
            wait(0.01)
            door.CFrame = door.CFrame * CFrame.new(0.2,0,0)
            end

            wait(3)

            for i = 1, 30 do
            wait(0.01)
            door.CFrame = door.CFrame * CFrame.new(-0.2,0,0)
            end

            light.BrickColor = BrickColor.new(1004)
            sensor.BrickColor = BrickColor.new(194)
            script.Parent.Script.Disabled = false

Okay, so when this activates, the script is stuck.
The "light" and "sensor" are stuck on New Yeller. [That's the 1009 Colour Code in this script]
Why is this happening?
I was thinking that you can't put a wait in a script without a function
But you cannot use while, looped, onTouched or onClicked on this sort of thing that's meant to activate when the correct person touches the sensor

Sorry if this is confusing XD

Please help :)
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
01 Dec 2011 11:19 AM
bump
Report Abuse
VIPdude007 is not online. VIPdude007
Joined: 18 Sep 2010
Total Posts: 1321
01 Dec 2011 11:36 AM
You got your capitals and lowers correct?
I only scanned through.
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
01 Dec 2011 11:47 AM
1) what is da script meant to do
2) any output
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
01 Dec 2011 12:24 PM
No output.
Come to my place, I'll show you.
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
01 Dec 2011 12:26 PM
Oh snap, he's offline.

The script, roughly:

Someone touches the sensor
If their name is in permission, the light goes yellow to process [Just to make it look better XD]
Then it goes green.
Door slides open.
Wait 3/4 seconds
Door closes.
Light turns red.

Where I said the light changes colour, so does the sensor, but the sensor is grey so when the light goes red, sensor goes grey. :D
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
01 Dec 2011 12:27 PM
I suggest you read the end of my first post. :D
Report Abuse
VIPdude007 is not online. VIPdude007
Joined: 18 Sep 2010
Total Posts: 1321
13 Dec 2011 03:46 PM
Wait, isn't the word "script" meant to be changed to "Script" a capital "S"?
Report Abuse
Scriptishish is not online. Scriptishish
Joined: 16 Oct 2007
Total Posts: 1231
13 Dec 2011 03:48 PM
^
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

script is script, to refer to itself.
Just like workspace is workspace, in reference to itself.
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
13 Dec 2011 03:48 PM
Nope.
I fixed this with a debounce and merged some scripts together, the script is working perfectly now :D
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 03:49 PM
How did you use the tab on the forum?
Or how did you indent on the forums?
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
13 Dec 2011 03:49 PM
wouldnt it be easyer to do;

function onTouched(hit)
if hit.Parent.Name == ("bob") or hit.Parent.Name == ("Vipdude007") then
door open/ close thingy here and anything else
else
end
end
??

people make scripting so difficult ...!

bob -- maker of scripty thingies for people who make life complicated lol ;D
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
13 Dec 2011 03:50 PM
oooo annnnnd

script.Parent.Touched:connect(onTouch)
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
13 Dec 2011 03:50 PM
Pokemon, it automatically does it
That's why some parts were missed out
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 03:51 PM
Not for meh. :c
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
13 Dec 2011 03:52 PM
wouldnt my way work alot easyer? :p

bob -- maker of scripty thingies for people who make life complicated lol ;D
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 03:56 PM
@bob
I think it would be better to use a table.
Users = {"pokemon771", "Telamon"}
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