|
| 13 Aug 2013 04:40 PM |
The script works up until line 15. I don't know why that happens. The value "Lost" is a bool value, and Time is a Number value. (Function "RaidCount()" is unused)
team = script.Parent.Parent.Spawn flag = script.Parent.Parent.Flag pole = script.Parent.Parent.Pole count = script.Parent.Time.Value raided = script.Parent.Lost
function onTouch(hit) local user = game.Players:GetPlayerFromCharacter(hit.Parent) if user ~= nil then team.Neutral = false team.BrickColor = user.TeamColor team.TeamColor = user.TeamColor flag.BrickColor = user.TeamColor pole.Handles.Color = user.TeamColor if user.TeamColor == ("Bright red") then --line 15 raided = true end end end
if raided == false then count = 0 end
while raided == true do while count < 60 do count = count + 1 wait(1) if count == 60 then RaidWin() end end end
function RaidCount() for i=1, 61 do if count == 60 then RaidWin() else if team.TeamColor == ("Bright red") then wait(1) count = count + 1 else break end end end end
function RaidWin() game.Lighting.RaidWin:clone().Parent = game.Workspace end
script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Aug 2013 04:44 PM |
| What? Is it a difficult thing to fix or is it something really obvious? |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 13 Aug 2013 04:45 PM |
its BrickColor.new'Bright red'
not ("Bright red") |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2013 04:46 PM |
| Dude, "HELP", Why wont it work. Cause ... You "HELP Fix this. Dude, scripting helpers is for people, to give advice on the error. And or help you locate it for you to fix! |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2013 04:52 PM |
robot, I tried that and it still doesn't set Lost to true.
if user.TeamColor == BrickColor.new'Bright red' then --line 15
Is it meant to be like that? |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 13 Aug 2013 04:52 PM |
team = script.Parent.Parent.Spawn flag = script.Parent.Parent.Flag pole = script.Parent.Parent.Pole count = script.Parent.Time.Value raided = script.Parent.Lost function onTouch(hit) local user = game.Players:GetPlayerFromCharacter(hit.Parent) if user ~= nil then team.Neutral = false team.BrickColor = user.TeamColor team.TeamColor = user.TeamColor flag.BrickColor = user.TeamColor pole.Handles.Color = user.TeamColor if user.TeamColor == BrickColor.new("Bright red") then --line 15 raided = true end end end if raided == false then count = 0 end while raided == true do while count < 60 do count = count + 1 wait(1) if count == 60 then RaidWin() end end end function RaidCount() for i=1, 61 do if count == 60 then RaidWin() else if team.TeamColor == BrickColor.new("Bright red") then wait(1) count = count + 1 else break end end end end function RaidWin() game.Lighting.RaidWin:clone().Parent = game.Workspace end script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2013 04:58 PM |
I tried that and it says this is the output
"Workspace.Flag.Spawn.Script:32: attempt to call global 'RaidWin' (a nil value)"
while raided == true do while count < 60 do count = count + 1 wait(1) if count == 60 then RaidWin() end end --line 32 end
Other than that, no changes. :(
|
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 13 Aug 2013 05:07 PM |
@Kill, You're trying to call the function, before it's made. That's why it's nil. Just move the function up the script, past where you try using it. |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2013 05:16 PM |
I'm sure that helps in the future, thanks.
But there's another problem. It prints that line 21 works, but the "Lost" value doesn't change. With or without the ".Value" on the end.
raided = script.Parent.Lost.Value
function onTouch(hit) local user = game.Players:GetPlayerFromCharacter(hit.Parent) if user ~= nil then team.Neutral = false team.BrickColor = user.TeamColor team.TeamColor = user.TeamColor flag.BrickColor = user.TeamColor pole.Handles.Color = user.TeamColor if user.TeamColor == BrickColor.new("Bright red") then --line 15 raided = true print 'line 21' end end end |
|
|
| Report Abuse |
|
|
| |
|