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 » Scripters
Home Search
 

Re: What is wrong with my script? Why doesn't it work?

Previous Thread :: Next Thread 
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 04:24 AM
So i have this:

function onTouch(part)
if (part.Name == "Grid") and TValue.Value == 1 then
debounce = false

script.Parent.Parent.TPWSo.WarnSystem.BD.Flash.Disabled = false



end

It's a train safety system. It is supposed to work, the script is in a sensor, when I go over it, the value is 1 too, it doesn't even do anything. Fix it please.
Report Abuse
TheShadowMessage is not online. TheShadowMessage
Joined: 21 Sep 2012
Total Posts: 10379
05 May 2017 05:40 AM
did u put the connect line in
Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 06:20 AM
I just added it, and it doesn't even help.

end
end
script.Parent.Touched:connect(onTouched)

Now TValue, debounce and OnTouched have a blue line below them. It's a warning. How do I fix this?
Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 06:24 AM
Removed the "ed" from OnTouched, fixed the blue line. But the others
Report Abuse
TheShadowMessage is not online. TheShadowMessage
Joined: 21 Sep 2012
Total Posts: 10379
05 May 2017 06:24 AM
change onTouched to onTouch
Report Abuse
TheShadowMessage is not online. TheShadowMessage
Joined: 21 Sep 2012
Total Posts: 10379
05 May 2017 06:26 AM
make sure TValue is defined before the function
and that isn't a real debounce (it isn't hurting anything but just informing you)
Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 06:28 AM
How do I define TValue? I am not that pro at scripting.
Report Abuse
TheShadowMessage is not online. TheShadowMessage
Joined: 21 Sep 2012
Total Posts: 10379
05 May 2017 06:30 AM
where is TValue?
TValue = script.Parent.Whatever
Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 06:32 AM
It's in a seperate part, I want it to work for multiple trains without grouping that part with the trains. I don't even understand what I am doing wrong. TValue is name of a value in the part called "Grid", which is in Workspace. There will be multiple grids, so how do I do this? I ain't gonna rename every single grid with numbers.
Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
05 May 2017 06:34 AM
If possible, can you give me the fixed script?
Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
05 May 2017 10:12 AM

script.Parent.Touched:connect(function(part)

if part.Name == "Grid" and TValue.Value == 1 then
debounce = false

script.Parent.Parent.TPWSo.WarnSystem.BD.Flash.Disabled = false

end
end)


Report Abuse
NewBuildmini is not online. NewBuildmini
Joined: 02 May 2015
Total Posts: 278
06 May 2017 12:59 AM
Still doesn't work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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