generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

syntax error near 'end' problem.

Previous Thread :: Next Thread 
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
25 Aug 2014 10:16 AM
I have a script that lets a player click a Text Button, which makes the Frame visible, and it makes two Text Buttons, which are children of the Frame. If you choose the Solo one it teleports you to the Story Base, and if you choose The Multiplayer one it teleports you to the baseplate. The problem is line 34, which is a simple end). Here's the script:

local PG = script.Parent
local F = script.Frame

F.Visible = false
PG.Visible = true
PG.MouseButton1Click:connect(function()
PG.MouseButton1Click:connect(Function)
PG.Text = "Loading StartGui..."
wait(5)
print("StartGui Loaded!")
PG.Text = "StartGui is loaded!"
wait(2)
F.Visible = true
PG.Visible = false
end)
F.BackgroundColor3 = UDim2.new(0,0,87)
Instance.new("TextButton").Parent = F
Instance.new("TextButton").Parent = F
SS = script.F:findFirstChild()
SS.Text = "Play Solo(Story)"
M = script.F:findSecondChild()
M.Text = "Play Multiplayer Mode"
SS.MouseButton1Down:connect(function()
SS.MouseButton1Down:connect(Function)
SS.Text = "Play by yourself in this story mode. Basically a training session for noobs."
SS.MouseButton1Click:connect(function()
SS.MouseButton1Click:connect(Function)
SS.Text = "Loading Story..."
wait(10)
print("Story Loaded!")
SS.Text = "Story is loaded. Will take you there."
wait(2)
local teleportLocalPlayer("StoryBase")
end) -- Here is the error.
end)
M.MouseButton1Down:connect(function()
M.MouseButton1Down:connect(Function)
M.Text = "Play with others in this multiplayer mode."
M.MouseButton1Click:connect(function()
M.MouseButton1Click:connect(Function)
M.Text = "Loading multiplayer mode..."
wait(10)
print("Multiplayer Loaded!")
M.Text = "Multiplayer loaded. Will take you there."
wait(2)
local teleportLocalPlayer("Baseplate")
end)
end)

I know, it's kind of sloppy. Please help!
Report Abuse
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
25 Aug 2014 01:16 PM
Please? :(
Report Abuse
plistra is not online. plistra
Joined: 12 Mar 2014
Total Posts: 859
25 Aug 2014 02:00 PM
try changing an "end)" to end, and switch "Function" to function a little higher. if doing "end" doesn't work, just try deleting it.
Report Abuse
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
26 Aug 2014 04:17 PM
What do you mean function a little higher?
Report Abuse
plistra is not online. plistra
Joined: 12 Mar 2014
Total Posts: 859
27 Aug 2014 11:30 AM
PG.MouseButton1Click:connect(Function)

unless you defined "Function", this wont run.
Report Abuse
plistra is not online. plistra
Joined: 12 Mar 2014
Total Posts: 859
27 Aug 2014 11:32 AM
local PG = script.Parent
local F = script.Frame

F.Visible = false
PG.Visible = true
PG.MouseButton1Click:connect(function()
PG.MouseButton1Click:connect(function) --whats the point of this?
PG.Text = "Loading StartGui..."
wait(5)
print("StartGui Loaded!")
PG.Text = "StartGui is loaded!"
wait(2)
F.Visible = true
PG.Visible = false
end)
F.BackgroundColor3 = UDim2.new(0,0,87)
Instance.new("TextButton").Parent = F
Instance.new("TextButton").Parent = F
SS = script.F:findFirstChild()
SS.Text = "Play Solo(Story)"
M = script.F:findSecondChild()
M.Text = "Play Multiplayer Mode"
SS.MouseButton1Down:connect(function()
SS.MouseButton1Down:connect(Function)
SS.Text = "Play by yourself in this story mode. Basically a training session for noobs."
SS.MouseButton1Click:connect(function()
SS.MouseButton1Click:connect(Function)
SS.Text = "Loading Story..."
wait(10)
print("Story Loaded!")
SS.Text = "Story is loaded. Will take you there."
wait(2)
local teleportLocalPlayer("StoryBase")
end)
M.MouseButton1Down:connect(function()
M.MouseButton1Down:connect(Function)
M.Text = "Play with others in this multiplayer mode."
M.MouseButton1Click:connect(function()
M.MouseButton1Click:connect(Function)
M.Text = "Loading multiplayer mode..."
wait(10)
print("Multiplayer Loaded!")
M.Text = "Multiplayer loaded. Will take you there."
wait(2)
local teleportLocalPlayer("Baseplate")
end)
end)

I don't know. This script is kinda really ugly.
Report Abuse
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
29 Aug 2014 03:37 PM
MouseButton1Click:connect(function() lets the player click it
I've read on ROBLOX Wiki that MouseButton1Click:connect(Function) makes the computer check if the player click.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image