|
| 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 |
|
|
|
| 05 May 2017 05:40 AM |
| did u put the connect line in |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 05 May 2017 06:24 AM |
| Removed the "ed" from OnTouched, fixed the blue line. But the others |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 06:24 AM |
| change onTouched to onTouch |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 05 May 2017 06:28 AM |
| How do I define TValue? I am not that pro at scripting. |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 06:30 AM |
where is TValue? TValue = script.Parent.Whatever |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 05 May 2017 06:34 AM |
| If possible, can you give me the fixed script? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|