generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help

Previous Thread :: Next Thread 
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
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
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 04:43 PM
/\
Yeah no!
Report Abuse
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
13 Aug 2013 04:44 PM
What? Is it a difficult thing to fix or is it something really obvious?
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
13 Aug 2013 04:45 PM
its BrickColor.new'Bright red'

not ("Bright red")
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
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
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
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 is not online. 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
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
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 is not online. 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
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
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
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
13 Aug 2013 06:58 PM
Bump. :C
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image