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: Crashes?

Previous Thread :: Next Thread 
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 04:40 PM
repeat if script.Parent.BackgroundColor3 == Color3.new(85/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3 + Color3.new(1/255, 0, 0)
wait()
end
until
script.Parent.BackgroundColor3 == Color3.new(100/255,1,0)

repeat if script.Parent.BackgroundColor3 == Color3.new(100/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3 - Color3.new(1/255, 0, 0)
wait()
end
until
script.Parent.BackgroundColor3 == Color3.new(85/255,1,0)

for some reason this crashes the game I have no idea why so please help fix it!
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
04 May 2014 04:41 PM
repeat if script.Parent.BackgroundColor3 == Color3.new(100/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3 - Color3.new(1/255, 0, 0)
wait()
end
until
script.Parent.BackgroundColor3 == Color3.new(85/255,1,0)


Because this

repeat if script.Parent.BackgroundColor3 == Color3.new(100/255,1,0) and script.Parent.Visible == true then

Is false
So the repeat loop doesn't wait()
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 04:43 PM
I don't get it really... so can you uh just fix it and explain more in-depth?
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
04 May 2014 04:44 PM
while true do
if false then
wait()
end
end

Its the same reason this would crash, or do you not know about infinite loops crashing yet? (Its okay if you don't, I'll explain)
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 04:45 PM
nvm I fixed the crashing part but it doesent like do anything.


repeat wait() if script.Parent.BackgroundColor3 == Color3.new(85/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3 + Color3.new(1/255, 0, 0)
wait()
end
until
script.Parent.BackgroundColor3 == Color3.new(100/255,1,0)

repeat wait() if script.Parent.BackgroundColor3 == Color3.new(100/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3 - Color3.new(1/255, 0, 0)
end
until
script.Parent.BackgroundColor3 == Color3.new(85/255,1,0)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
04 May 2014 04:47 PM
It doesn't do anything because this
if script.Parent.BackgroundColor3 == Color3.new(100/255,1,0) and script.Parent.Visible == true then

Is false
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 04:48 PM
yhea this is true though : if script.Parent.BackgroundColor3 == Color3.new(85/255,1,0) and script.Parent.Visible == true then
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 04:49 PM
Output -
16:45:07.700 - Players.Player1.PlayerGui.ScreenGui.OverlayG.Script:2: attempt to perform arithmetic on field 'BackgroundColor3' (a userdata value)
16:45:07.700 - Stack Begin
16:45:07.701 - Script 'Players.Player1.PlayerGui.ScreenGui.OverlayG.Script', Line 2
16:45:07.702 - Stack End
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
04 May 2014 04:52 PM
script.Parent.BackgroundColor3 = Color3.new(script.Parent.BackgroundColor3.r - 1/255, 0, 0)
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 05:04 PM
new script (immediately turns red and doesn't work)

repeat wait() if script.Parent.BackgroundColor3.g >= 150/255 and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = Color3.new(script.Parent.BackgroundColor3.g + 1/255)
wait()
end
until
script.Parent.BackgroundColor3 == Color3.new(85/255,1,0)

repeat wait() if script.Parent.BackgroundColor3 == Color3.new(85/255,1,0) and script.Parent.Visible == true then
script.Parent.BackgroundColor3 = Color3.new(script.Parent.BackgroundColor3.g - 1/255)
end
until
script.Parent.BackgroundColor3 == Color3.new(85/255,150/255,0)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
04 May 2014 05:07 PM
I said
Color3.new(script.Parent.BackgroundColor3.r - 1/255, 0, 0)

not
Color3.new(script.Parent.BackgroundColor3.g - 1/255)
Report Abuse
Zeloi is not online. Zeloi
Joined: 27 Sep 2010
Total Posts: 1143
04 May 2014 05:07 PM
Newer script - doesn't turn red but still doesn't work

repeat wait() if script.Parent.BackgroundColor3.g >= 150 and script.Parent.Visible == true then
script.Parent.BackgroundColor3.g = Color3.new(script.Parent.BackgroundColor3.g + 1/255)
wait()
end
until
script.Parent.BackgroundColor3.g == 255

repeat wait() if script.Parent.BackgroundColor3.g == 255 and script.Parent.Visible == true then
script.Parent.BackgroundColor3.g = Color3.new(script.Parent.BackgroundColor3.g - 1/255)
end
until
script.Parent.BackgroundColor3.g == 150
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