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
8 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

local player = script.Parent.Parent.Parent.Parent
local Background1 = script.Parent:WaitForChild("Background1")
local Background2 = script.Parent:WaitForChild("Background2")
local Background3 = script.Parent:WaitForChild("Background3")
local SBackground = script.Parent:WaitForChild("ShuttleBackground")
local Shade = SBackground:WaitForChild("Shade")
local Select = Shade:WaitForChild("Select")
local Shuttle1 = Select:WaitForChild("Shuttle1") --Grand Central Shuttle
local Shuttle2 = Select:WaitForChild("Shuttle2") --Franklin Avenue Shuttle
local Shuttle3 = Select:WaitForChild("Shuttle3") --Rockaway Park Shuttle

script.Parent.ShuttleBackground.Shade.Select.Shuttle1.MouseButton1Click:connect(function()
    print("Ready")
    player.Character:MoveTo(game.Workspace.GCTS)
    print("Finished")
end)

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 — 8y
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 — 8y

Answer this question