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 |
|
|
| |
|
devTools
|
  |
| Joined: 06 Sep 2014 |
| Total Posts: 7950 |
|
|
| 02 Nov 2014 09:45 AM |
| What are you trying to do exactly? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 02 Nov 2014 09:46 AM |
| x.Tool.Handle.BrickColor = BrickColor.new("Bright green") |
|
|
| Report Abuse |
|
|
Raidorz
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 5221 |
|
|
| 02 Nov 2014 09:48 AM |
I get
')' expected near green error. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 5221 |
|
| |
|
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
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 02 Nov 2014 10:04 AM |
| Workspace.Player does not exist. Ever |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
|
| 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 |
|
|