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
 

'(' near error

Previous Thread :: Next Thread 
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:44 AM
My script, I was practicing.




Workspace.Player = x

function onActivated
x.Tool.Handle.Properties.Brickcolor.new(Bright green)

end





Output:

Workspace.Player.Tool.Handle.Script:4: '(' expected near 'x'

I don't really understand this.
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
02 Nov 2014 09:45 AM
function onActivated()
Report Abuse
devTools is online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
02 Nov 2014 09:45 AM
What are you trying to do exactly?
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:46 AM
Thanks a lot.

Why do you have to put the brackets after?
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
02 Nov 2014 09:46 AM
x.Tool.Handle.BrickColor = BrickColor.new("Bright green")
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:48 AM
I get

')' expected near green error.
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:50 AM
Nvm fixed it.

Now I get: Player is not a valid member of Workspace

??
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
02 Nov 2014 09:51 AM
The brackets are just syntax I believe

But
function number(num,multiply)
return num * multiply
end

print(number(8,2))


if you make a function you can give it info to use Inside the brackets
Report Abuse
AdorableFerretsRus is not online. AdorableFerretsRus
Joined: 27 May 2012
Total Posts: 3903
02 Nov 2014 09:52 AM
Two fixes:

function onActivated()

You have to put the brackets to show that it's the end of your function name. Don't worry about putting anything inside them; that's for more complex functions.

("Bright green")

Without the quotation marks, it means it's a variable. You never define what Bright green is, so you have to put the quotation marks.

c:
Report Abuse
AdorableFerretsRus is not online. AdorableFerretsRus
Joined: 27 May 2012
Total Posts: 3903
02 Nov 2014 09:53 AM
Oh, and for your last error, you have to explain what you're trying to do for us to help.
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:54 AM
Alright thanks, fixed it. Now I have another problem. When I'm trying to execute the script it says

Player is not a valid member of Workspace.

??
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:55 AM
Alright, basically what I'm trying to do is turn the brick green when you click.

I'm just practicing.
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 09:58 AM
So, I'm trying to turn the brick Bright green when you click on the screen.
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
02 Nov 2014 10:02 AM
No, nobody?

sigh
Report Abuse
devTools is online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
02 Nov 2014 10:04 AM
If you want, you could do a localscript inside a screen gui that covers the entire screen and say:

script.Parent.MouseClick:connect(function()
game.Workspace.BRICK_NAME.BrickColor = BrickColor.new("Bright green")
end)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Nov 2014 10:04 AM
Workspace.Player does not exist. Ever
Report Abuse
devTools is online. devTools
Joined: 06 Sep 2014
Total Posts: 7950
02 Nov 2014 10:06 AM
@eLunate
Not true. There could be something in workspace named player or you could have a table find a random player and call it player and find the player's name.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Nov 2014 10:10 AM
You know what I mean.
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
02 Nov 2014 12:43 PM
for i,v in ipairs(game.Workspace:GetChildren()) do
if v.Humanoid then
-- code
end
end

Would that work?
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