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: Help with change team GUI!

Previous Thread :: Next Thread 
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 08:48 AM
Here is a admin GUI I made, so when you select a character, and then click the "Change team button", then the GUI which has the team colors will pop up.

Now when you click on team, that person's team should change to that team instantly. HEre is the script I made, but it still doesn't work:



function Click(mouse)
usr = game.Players:findFirstChild(script.Parent.Parent.uname.Text)
script.Parent.MouseButton1Down:connect(function()
game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright green")
end
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 11:02 AM
Please help, basically it is an admin GUI. When the admin clicks someone's username, it will show up the character and a list of options to do to them. One of the options I have is to change color. Here is what I have so far:



script.Parent.MouseButton1Down:connect(function()
game.Players:findFirstChild.TeamColor = BrickColor.new("Bright violet")
end)



Doesn't work properly though, it just takes player off all teams.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 11:02 AM
I meant, "One of the options I have is to change TEAM"
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 11:36 AM
Please help me out...
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 05:16 PM
Bump.
Report Abuse
Sharpshooter26 is not online. Sharpshooter26
Joined: 26 May 2010
Total Posts: 5166
28 Aug 2012 05:37 PM
function onClick()

--script


Connection line

from my experience it works a bit better
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
28 Aug 2012 06:39 PM
Ummm. what?
Report Abuse
bigG123 is not online. bigG123
Joined: 17 Feb 2008
Total Posts: 4117
28 Aug 2012 07:02 PM
He's trying to tell you to use the OnClick() function instead of that one, as it works better.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 08:52 AM
It didn't work at all.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
29 Aug 2012 09:43 AM
You idiots, (not op). You can't do this: game.Players:findFirstChild

This item is deprecated. Do not use it for new work.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
29 Aug 2012 09:43 AM
also, it doesn't matter what you call the function name, as long as you connect it right.

This item is deprecated. Do not use it for new work.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 09:53 AM
Can you help me then? I have the part where you click the username, it brings up the person's avatar, and some options I can do to them. I can click "unff" which will take the ff off.

So when I click the team color button "Red", then the person much switch to that team.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 10:42 AM
Bump...
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
29 Aug 2012 11:11 AM
Use a local script.

Then,

local player = game.Players.LocalPlayer

function yeah()
player.TeamColor = BrickColor.new("Dark stone grey")
end

script.Parent.TeamA.MouseButton1Down:connect(yeah)

"Improvise, Overcome, and Adapt." -Captain (RIP) (Boo on-screen keyboards!)
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 11:39 AM
Didn't work.
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
29 Aug 2012 12:40 PM
LocalScript:
script.Parent.MouseButton1Down:connect(function()
game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright blue") -- change that to the color of the team
end)

Regular script:
function onClick()
script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end

script.Parent.MouseButton1Down:connect(onClick)


You need both a local and regular script. If you don't want it to kill remove the regular script.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 01:55 PM
@Blind

THANK YOU! All I needed to to was put the script into local! :D
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
29 Aug 2012 02:26 PM
Courtesy Of Merlin Tech Company.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 05:57 PM
I didn't work properyl! It only changes my team, not the person I have selected!
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
29 Aug 2012 05:58 PM
Then you need to define that person as player.

Read: [ http://www.roblox.com/Forum/ShowPost.aspx?PostID=76952327 ]
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 07:06 PM
But the person is defined. Someone clicks the person's username, and this is what is inside of that button:














function Click(mouse)
local check = game.Players:findFirstChild(script.Parent.Text)
if check ~= nil then
findit = script.Parent.Parent.Parent.usr:GetChildren()
for i = 1, #findit do
if findit[i].Name ~= "Character" then
if findit[i].Name ~= "TitleBar" then
findit[i].Name = script.Parent.Text
end
end
if script.Parent.Parent.Parent.CU ~= nil then
script.Parent.Parent.Parent.CU.Value = script.Parent.Text
g = script.Parent.Parent.Parent.usr.Character:GetChildren()
for i = 1, #g do
g[i].Visible = true
end
end
end
script.Parent.Parent.Parent.usr.Visible = true
end
end

script.Parent.MouseButton1Down:connect(Click)














Then, that person can commit admin commands on him. I can click "FFON" button and an FF will go onto that person. This is what is in the FF button:





function Click(mouse)
usr = game.Players:findFirstChild(script.Parent.Parent.uname.Text)
if usr ~= nil then
usr2 = usr.Character:findFirstChild("ForceField")
if usr2 == nil then
ff = Instance.new("ForceField")
ff.Parent = usr.Character
end
end
end


script.Parent.MouseButton1Down:connect(Click)





So the person is defined...
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 07:24 PM
Help?
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
29 Aug 2012 07:33 PM
I thought you only wanted a regular team change.
I don't know how to do whats wrong.
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
29 Aug 2012 08:00 PM
Well I could easily make a regular team change. I am doing what is above.
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
29 Aug 2012 08:07 PM
You don't listen well.

You need to define player as the target person.

Read: [ http://www.roblox.com/Forum/ShowPost.aspx?PostID=76952327 ]
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