|
| 11 Dec 2011 04:32 PM |
When I touch the brick, it does not do the disable function. Im trying to disable these scripts, but for some reason does not do anything. I ve checked everything. I also checked and the names were right. Heres the script: ----------------------------------------------------------------------- function onTouched(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == game.Teams.Reds.TeamColor then getteams() else script.Parent.CanCollide = false wait(4) script.Parent.CanCollide = true end end end
function getteams()
h = Instance.new("Message") h.Parent = game.Workspace h.Name = "RedAreWiners"
c=game.Players:children() for i=1, #c do if c[i].TeamColor==BrickColor.new(21) then c[i].leaderstats.Money.Value = c[i].leaderstats.Money.Value + 1500 elseif c[i].TeamColor==BrickColor.new(23) then c[i].leaderstats.Money.Value = c[i].leaderstats.Money.Value + 500 end h.Text = "MISSION ACCOMPLISHED! REDS GET +1500 MONEY!" wait(5) p=game.Workspace:children() for i=1, #p do if p[i].Name == "RedAreWinners" then p[i]:Remove() disable() end end end end
function disable() game.Workspace.GiveWeapons.Disabled = true game.Workspace.DeathScript.Disabled = false game.Workspace.BaseSet.Disabled = false game.Workspace.StartMessage:Remove() game.Workspace.Starter.Disabled = true wait(6) game.Workspace.BaseSet.Disabled = true game.Workspace.DeathScript.Disabled = true game.Workspace.TeamTeleport.Disabled = true game.Workspace.Starter.Disabled = false end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
Lowcart
|
  |
| Joined: 12 Sep 2011 |
| Total Posts: 1323 |
|
| |
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 11 Dec 2011 04:36 PM |
function onTouched(hit) if (game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil) then if (game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == game.Teams.Reds.TeamColor) then getteams() else script.Parent.CanCollide = false wait(4) script.Parent.CanCollide = true end end end
function getteams()
h = Instance.new("Message") h.Parent = game.Workspace h.Name = "RedAreWiners"
c=game.Players:GetChildren() for i=1, #c do if c[i].TeamColor==BrickColor.new(21) then c[i].leaderstats.Money.Value = c[i].leaderstats.Money.Value + 1500 elseif c[i].TeamColor==BrickColor.new(23) then c[i].leaderstats.Money.Value = c[i].leaderstats.Money.Value + 500 end h.Text = "MISSION ACCOMPLISHED! REDS GET +1500 MONEY!" wait(5) p=game.Workspace:GetChildren() for i=1, #p do if p[i].Name == "RedAreWinners" then p[i]:Remove() disable() end end end end
function disable() game.Workspace.GiveWeapons.Disabled = true game.Workspace.DeathScript.Disabled = false game.Workspace.BaseSet.Disabled = false game.Workspace.StartMessage:Remove() game.Workspace.Starter.Disabled = true wait(6) game.Workspace.BaseSet.Disabled = true game.Workspace.DeathScript.Disabled = true game.Workspace.TeamTeleport.Disabled = true game.Workspace.Starter.Disabled = false end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2011 04:45 PM |
| Thanks Lowcart, Thats what the problem was. I would've never figured it out. |
|
|
| Report Abuse |
|
|