|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Aug 2012 11:02 AM |
| I meant, "One of the options I have is to change TEAM" |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Aug 2012 05:37 PM |
function onClick()
--script
Connection line
from my experience it works a bit better |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
| |
|
|
| 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 |
|
|
|
| 29 Aug 2012 01:55 PM |
@Blind
THANK YOU! All I needed to to was put the script into local! :D |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2012 02:26 PM |
| Courtesy Of Merlin Tech Company. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 29 Aug 2012 08:00 PM |
| Well I could easily make a regular team change. I am doing what is above. |
|
|
| Report Abuse |
|
|
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 |
|
|