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: GUI Script

Previous Thread :: Next Thread 
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 03:01 PM
Alright, I am making this GUI that will allow you to change teams based on your rank in a group. For some reason it isnt changing your spawns, im pretty sure I have all the spawns and everything set up and I know its this script that is doing it because it exceutes the other part. Anyways, here it is:

player = script.Parent.Parent.Parent.Parent

function Click(mouse)
if player:GetRankInGroup(734737) == 254 then
player.TeamColor = BrickColor.new("Dark green")
end
end

script.Parent.MouseButton1Down:connect(Click)


Please help!
Report Abuse
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 03:18 PM
bump
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
20 Dec 2012 03:33 PM
function Click()
if player:GetRankInGroup(734737) == 254 then -- why not use GetRoleInGroup and then the string name.
player.TeamColor = BrickColor.new("Dark green")
end
end

script.Parent.MouseButton1Down:connect(Click)

Fixed
Report Abuse
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 04:17 PM
Can you show me that? Not quite sure what your trying to say.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Dec 2012 04:18 PM
GetRoleInGroup() returns a string with the player's rank

¤ † KMXD† ¤
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
20 Dec 2012 04:18 PM
role = "Super l33t admin"


function Click()
if player:GetRoleInGroup(734737) == role then -- why not use GetRoleInGroup and then the string name.
player.TeamColor = BrickColor.new("Dark green")
end
end

script.Parent.MouseButton1Down:connect(Click)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Dec 2012 04:19 PM
Also, player is not defined. I'd recommend using a localscript + localplayer because it would be easier, and I don't know your hierarchy.

¤ † KMXD† ¤
Report Abuse
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 04:31 PM
Ok, well as you probably noticed, I am a rookie scripter. I took the script added on here and heres what it looks like now:

player = script.Parent.Parent.Parent.Parent

role = "President & Premier"

function Click()
if player:GetRoleInGroup(734737) == role then
player.TeamColor = BrickColor.new("Dark green")
end
end

script.Parent.MouseButton1Down:connect(Click)

This still isnt working. I have Teams and Spawns all set up, and I cant figure this out.
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
20 Dec 2012 04:34 PM
player = script.Parent.Parent.Parent.Parent -- This might be off

role = "President & Premier" -- This has to be the same as the group role.

function Click()
if player:GetRoleInGroup(734737) == role then
player.TeamColor = BrickColor.new("Dark green")-- You sure it's this color?
end
end

script.Parent.MouseButton1Down:connect(Click)
Report Abuse
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 04:39 PM
I think my variables are off.

The script is within a text button,
The text button is within the frame
The frame is within a screen GUI
And the Screen GUI is within the StarterGUI folder

did I do it right?
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
20 Dec 2012 04:40 PM
player = script.Parent.Parent.Parent.Parent.Parent
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
20 Dec 2012 04:42 PM
OR You put the script in a localscript. Then, you can use:

player = game.Players.LocalPlayer
Report Abuse
wsd906 is not online. wsd906
Joined: 27 Jan 2009
Total Posts: 9880
20 Dec 2012 04:46 PM
FINALLY GOT IT. Thank you guys so much, it was because I missed the Parent thing.

God bless all whom delt through my rookiness today :)
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
20 Dec 2012 04:54 PM
Next time, check and post the output, then we can determine errors much more quickly
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