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

Why is this script malfunctioning?

Asked by
mine248 40
9 years ago

I've been building a game, and I have a LocalScript, and I have the script.

So I've tried this line of script

01local player = script.Parent.Parent.Parent.Parent
02local Background1 = script.Parent:WaitForChild("Background1")
03local Background2 = script.Parent:WaitForChild("Background2")
04local Background3 = script.Parent:WaitForChild("Background3")
05local SBackground = script.Parent:WaitForChild("ShuttleBackground")
06local Shade = SBackground:WaitForChild("Shade")
07local Select = Shade:WaitForChild("Select")
08local Shuttle1 = Select:WaitForChild("Shuttle1") --Grand Central Shuttle
09local Shuttle2 = Select:WaitForChild("Shuttle2") --Franklin Avenue Shuttle
10local Shuttle3 = Select:WaitForChild("Shuttle3") --Rockaway Park Shuttle
11 
12script.Parent.ShuttleBackground.Shade.Select.Shuttle1.MouseButton1Click:connect(function()
13    print("Ready")
14    player.Character:MoveTo(game.Workspace.GCTS)
15    print("Finished")
16end)

But it fails, as the Output says:

20:37:06.008 - Script 'Players.Player.PlayerGui.ScreenGui.LocalScript', Line 38 20:37:06.009 - Stack End

Any solution?

0
can you show your localscript code? XToonLinkX123 580 — 9y
0
According to the output, the error is on line 38 of your script. You're only showing 16 lines. Also, with LocalScripts, you don't need to say "scripy.Parent.Parent.Parent.Parent". You just say "game.Players.LocalPlayer" and the LocalScript will know who you're talking about. funyun 958 — 9y

Answer this question