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
 

Re: Simple Script Broke

Previous Thread :: Next Thread 
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:31 PM
script.Parent.MouseButton1Down:connect(function()
Character = game.Players.PlayerAdded
Joke = game.Players.Player.Character.Backpack
Character.PlayerGui.Element.ChooserFrame:Remove()
game.Lighting.Fire:clone().Parent = Joke
end)

This is supposed to be a element chooser, it says

21:27:55.749 - Player is not a valid member of Players
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
06 Mar 2014 08:33 PM
script.Parent.MouseButton1Down:connect(function()
character = game.Players.PlayerAdded
Joke = game.Players.character.Character.Backpack
Character.PlayerGui.Element.ChooserFrame:Remove()
game.Lighting.Fire:clone().Parent = Joke
end)
Report Abuse
lama321 is not online. lama321
Joined: 18 Dec 2011
Total Posts: 300
06 Mar 2014 08:34 PM
... playeradded is an event, not a property or, unless a player is named PlayerAdded, a child of players ....
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:44 PM
Dude, that army guy, doesn't know his functions. You can't use PlayerAdded as a parent man. I hope this made you think.
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:44 PM
Ohhh, I made it as a parent too... xD I didn't look at what I was doing..
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:46 PM
script.Parent.MouseButton1Down:connect(function()
character = game.Players.LocalPlayer
Joke = game.Players[character].Backpack
character.PlayerGui.Element.ChooserFrame:Remove()
game.Lighting.Fire:clone().Parent = Joke
end)

Done
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:50 PM
Won't work man, should this be in a local script.
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
06 Mar 2014 08:51 PM
Oops lol sorry. Just saw that. xD Forgive me for that. I'm not having my best scripting days today...
Report Abuse
devLucas is not online. devLucas
Joined: 10 Dec 2013
Total Posts: 526
06 Mar 2014 08:51 PM
script.Parent.MouseButton1Down:connect(function()
character = game.Players.LocalPlayer
Joke = character.Backpack
character.PlayerGui.Element.ChooserFrame:Destroy()
game.Lighting.Fire:clone().Parent = Joke
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:52 PM
Erm,this coming from the guy defining a player as game.Players.PlayerAdded?
It should work
Yes it has to be a localscript
Report Abuse
devLucas is not online. devLucas
Joined: 10 Dec 2013
Total Posts: 526
06 Mar 2014 08:53 PM
@Island, next time, check your code before insulting someone.

You put:
character = game.Players.LocalPlayer
Joke = game.Players[character].Backpack

Which defined the Player twice, breaking the code.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:53 PM
Oh gosh,dev is the only oje that's right..
Looked at my script..
My brains not on today......
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:54 PM
dev, should this be in a Local Script?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:55 PM
@dev
Yeah,my brain is like,not on today......
But I had every right to say the bit I said tho..
He DID try to use an event for a player..

That's like saying

Plr = game.Players.PlayerAdded
print(Plr.Name)
Report Abuse
devLucas is not online. devLucas
Joined: 10 Dec 2013
Total Posts: 526
06 Mar 2014 08:55 PM
Yeah, put it into a LocalScript.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:55 PM
Anything using LocalPlayer needs to be in LocalScript..
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 08:56 PM
Yea, I know, just wanted to check, not my best scripting day...
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 08:57 PM
Lol,same....
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
06 Mar 2014 09:00 PM
Thanks guys! It works!
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