|
| 15 Jul 2016 12:11 AM |
So, i enabled filtering so i could use local blocks but none of the click GUI scripts work what is wrong with it.
Script:[
script.Parent.MouseButton1Down:connect(function() plr = game.Players.LocalPlayer plr.TeamColor = BrickColor.new("Bright red") script.Parent.Visible = false game.Workspace["Left Menu"].Part.SurfaceGui.Frame.Blue.Visible = false end)
]
Note:[
I tried it in both Local and Server scripts..
] |
|
|
| Report Abuse |
|
|
wfvj014
|
  |
| Joined: 30 Apr 2012 |
| Total Posts: 145 |
|
|
| 15 Jul 2016 12:18 AM |
First of all, you need to use a Local Script. Now I haven't really used Team Service too much, but I'm pretty sure Local Scripts can't change a player's Team Color. It's also worth pointing out that Local Script don't work in workspace, and I'm going to assume this Local Script is in StarterGui.
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function() script.Parent.Visible = false game.Workspace["Left Menu"].Part.SurfaceGui.Frame.Blue.Visible = false end)
Good Luck. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:20 AM |
| Yep you sure did help alot.... |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:25 AM |
| also it isnt in screen gui smart guy its in a screen gui learn to read... |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jul 2016 01:13 AM |
If you want to change the players' TeamColor, you need Remote events.
Put a RemoteEvent in workspace and insert a script into it:
script.Parent.OnServerEvent:connect(function(plr,color) plr.TeamColor = color end)
And then make a localscript inside the button:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function() script.Parent.Visible = false --And whatever GUI code you need --Then you need to fire the RemoteEvent for the server: game.Workspace.RemoteEvent:FireServer(BrickColor.new('Bright red')) end) |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 01:35 AM |
https://www.youtube.com/playlist?list=PLatbVFCcsDB9JZE_1WQvmG0i4NrpNIybs
Learn what FilteringEnabled is and what it does.
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|