Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script Fixed, but Doesn't Function Like I want it To Do?

Asked by 6 years ago

This script was fixed by Zafirua and surprisingly it didn't work. This time I added the Output, along with the picture of the studio of what I have on my Workspace, and the script fixed by Zafirua, which I want to say thank you so much!

https://imgur.com/CejNXXc

01-- [Declaration Section]
02local Up               = script.Parent.Up;
03local Down             = script.Parent.Down;
04local Left             = script.Parent.Left;
05local Right            = script.Parent.Right;
06 
07--\\ Variables
08local UpOn             = false;
09local DownOn           = false;
10local LeftOn           = false;
11local RightOn          = false;
12 
13-- [Processing Section]
14local function On_Clicked ()
15    if not UpOn then
View all 53 lines...

Output 22:39:58.389 - ClickDetector is not a valid member of Model 22:39:58.392 - Stack Begin 22:39:58.393 - Script 'Workspace.RemoteControl.Script', Line 53 22:39:58.393 - Stack End

0
Post the hierarchy. User#19524 175 — 6y
0
The script must be inside of the parts which are inside of the model . based on your screenshot User#17685 0 — 6y

2 answers

Log in to vote
1
Answered by
Delude_d 112
6 years ago
Edited 6 years ago
1-- Try script.Parent:WaitForChild("ClickDetector").MouseClick:Connect(On_Clicked);
2-- If it errors, or not work. It means, clickdetector is being called too early. Try fixing it using a wait, find, or any other useful ones.
0
huh?? Delude_d 112 — 6y
0
You’re saying the ClickDetector is being called too early. What?? User#19524 175 — 6y
0
It is, before it can load in either that or the object doesn't exist. Delude_d 112 — 6y
0
"Before it can load" so I have to use game:WaitForChild("Players") or wait(500000000) game:GetService("Players") ? User#19524 175 — 6y
View all comments (4 more)
0
Not my point. Delude_d 112 — 6y
0
It's not misinformation, It's what he learnt. Aren't we all trying to help? , Please be kind. User#17685 0 — 6y
0
I'll upvote this. I don't see why this is misinformation. brokenVectors 525 — 6y
0
Did he just removed his qwerty comment? hmmmm? lmao User#17685 0 — 6y
Ad
Log in to vote
-1
Answered by 6 years ago

Should you try?

01-- [Declaration Section]
02local Up               = script.Parent.Up;
03local Down             = script.Parent.Down;
04local Left             = script.Parent.Left;
05local Right            = script.Parent.Right;
06 
07--\\ Variables
08local UpOn             = false;
09local DownOn           = false;
10local LeftOn           = false;
11local RightOn          = false;
12 
13-- [Processing Section]
14local function On_Clicked (which)
15  if which == "Up" then
View all 56 lines...
0
Error. User#19524 175 — 6y
0
That doesn't work. The first error mentioned was to put the ')' after line 53 which I did. But it didn't function as it was supposed to do. This is the output: 13:15:27.358 - Attempt to connect failed: Passed value is not a function 13:15:27.360 - Stack Begin 13:15:27.362 - Script 'Workspace.RemoteControl.Control', Line 56 13:15:27.362 - Stack End 13:15:41.055 - attempt to call a nil value (x3) RobotChitti 167 — 6y
0
Thanks, bud. I did something like that before, hmmmmm but anyway , Thanks , lmao User#17685 0 — 6y

Answer this question