TheAlaska
|
  |
| Joined: 21 Jan 2011 |
| Total Posts: 152 |
|
|
| 28 Jun 2016 12:35 PM |
So this script gets inserted into every Player that joins the map
function onChanged(changed) if script.Parent.TeamColor == game.Lighting.Team1.Value then script.Parent.TribeValue.Value = 1 end end script.Parent.TeamColor.Changed:connect(onChanged)
Except when the Player's TeamColor changes, nothing happens.
|
|
|
| Report Abuse |
|
|
|
| 28 Jun 2016 12:48 PM |
try temporarily putting more noticeable things in the onChanged function to see if it is actually being run. if it is, then the problem lies within the code for the function. for example: function onChanged(changed) print'color changed!' end end script.Parent.TeamColor.Changed:connect(onChanged)
if run it you see "color changed!" in the output, then something is wrong with the function's code. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2016 12:50 PM |
| Is the 'Team1' object a BrickColorValue? |
|
|
| Report Abuse |
|
|
TheAlaska
|
  |
| Joined: 21 Jan 2011 |
| Total Posts: 152 |
|
|
| 28 Jun 2016 12:54 PM |
Yes it's a brickcolor value
--
The function isn't connecting at all. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2016 12:56 PM |
Oh whoops, I see what it is now. There isn't a Changed event for the TeamColor property. However, the Player does have a a Changed event. You'll just have to check and see what was changed by doing something like this.
script.Parent.Changed:connect(function(changedproperty) if not (changedproperty == 'TeamColor') then return end -- code here end) |
|
|
| Report Abuse |
|
|
TheAlaska
|
  |
| Joined: 21 Jan 2011 |
| Total Posts: 152 |
|
|
| 28 Jun 2016 01:28 PM |
clone = game.ServerScriptService.VoteGui:Clone()
function onclick(clicker) if game.Workspace[clicker.Name].Head.VoterValue.Value == false then game.Workspace[clicker.Name].Head.VoterValue.Value = true clone:Clone().Parent = game.Players[clicker.Name].PlayerGui end end script.Parent.ClickDetector.MouseClick:connect(onclick)
Did I do something wrong here? It's still not working. |
|
|
| Report Abuse |
|
|