My local script does not work
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Visible = false then local TeleportService = game:GetService("TeleportService") local Place = 9046212678 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() TeleportService:Teleport(Place, player) then local frame = script.Parent.Parent.Info local open = false script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true end) end) end) end)
What are the then
s at lines 3 and 11 for? They should be removed - they cause a SyntaxError.
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Visible = false local TeleportService = game:GetService("TeleportService") local Place = 9046212678 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() TeleportService:Teleport(Place, player) local frame = script.Parent.Parent.Info local open = false script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true end) end) end) end)
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Visible = false local TeleportService = game:GetService("TeleportService") local Place = 9046212678 local player = game:GetService("Players").LocalPlayer TeleportService:Teleport(Place, player) local frame = script.Parent.Parent.Info if frame.Visible == false then frame.Visible = true end end)
Just like Aimarekin said, your original script includes syntax errors at line 3, and line 11. then
should only be used in if statements. (ex. if value then end
)
Your original script also connects the same function inside the same function. Why would you want to connect the same function inside the same function when you already have a main function that detects the clicks? Those unnecessary functions should be removed.
I don't know why you have a variable called open
even though it's not being used.
Please let me know if you have any further issues.