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: My repeating script wont work in script builder..

Previous Thread :: Next Thread 
H1dden is not online. H1dden
Joined: 07 Jun 2011
Total Posts: 27
03 Sep 2011 02:55 PM
-- here it is

local screen, image = Instance.new('ScreenGui'), Instance.new('ImageLabel')

screen.Parent = game:service('StarterGui')
image.Parent = screen

image.Position = UDim2.new(.100, -5, .70)
image.Size = UDim2.new(.2, 900, .2, 0)
image.Image = 'http://www.roblox.com/asset/?id=60958137'
image.BackgroundTransparency = 0

while true do
image.BorderColor3 = Color3.new(math.random(), math.random(), math.random())
image.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random())
wait(0.1)
end

- It will only show one random color when I have a random color changeing script in..
for index,plr in pairs(game:service('Players'):children()) do
if plr:findFirstChild('PlayerGui') ~= nil then
screen:clone().Parent = plr.PlayerGui
end
end

Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
03 Sep 2011 02:56 PM
local screen, image = Instance.new('ScreenGui'), Instance.new('ImageLabel')

screen.Parent = game:service('StarterGui')
image.Parent = screen

image.Position = UDim2.new(.100, -5, .70)
image.Size = UDim2.new(.2, 900, .2, 0)
image.Image = 'http://www.roblox.com/asset/?id=60958137'
image.BackgroundTransparency = 0

while true do
image.BorderColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
image.BackgroundColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
wait(0.1)
end
Report Abuse
H1dden is not online. H1dden
Joined: 07 Jun 2011
Total Posts: 27
03 Sep 2011 03:08 PM
Still doesent work..
Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
03 Sep 2011 03:11 PM
*upon closer examination*



local screen, image = Instance.new('ScreenGui', game.StarterGui), Instance.new('ImageLabel', screen)

image.Position = UDim2.new(.100, -5, .70, 0)
image.Size = UDim2.new(.2, 900, .2, 0)
image.Image = 'http://www.roblox.com/asset/?id=60958137'
image.BackgroundTransparency = 0

while true do
image.BorderColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
image.BackgroundColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
wait(0.1)
end

Now?
Report Abuse
H1dden is not online. H1dden
Joined: 07 Jun 2011
Total Posts: 27
03 Sep 2011 03:14 PM
No that just made it stop working.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
03 Sep 2011 03:14 PM
*tries to be calm*
Give the output.
Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
03 Sep 2011 03:15 PM
local screen, image = Instance.new('ScreenGui'), Instance.new('ImageLabel')

screen.Parent = game:service('StarterGui')
image.Parent = screen

image.Position = UDim2.new(.100, -5, .70)
image.Size = UDim2.new(.2, 900, .2, 0)
image.Image = 'http://www.roblox.com/asset/?id=60958137'
image.BackgroundTransparency = 0

while true do
image.BorderColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
image.BackgroundColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
wait(0.1)
end



So what exactly would the problem be with this one?
Report Abuse
H1dden is not online. H1dden
Joined: 07 Jun 2011
Total Posts: 27
03 Sep 2011 03:24 PM
-"So what exactly would the problem be with this one?" =

Well my friend, I played the server in my test game and all's it does is choose's a random color. No, I need it to repeat.
Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
03 Sep 2011 03:35 PM
Oh, I see what's happening.
It's changing the color of the gui in the StarterGui. So when you respawn it will clone that exact copy of it at the time with it's color and place it into your startergui. It will continue to change the color of the one in the StarterGui, not the one you have.

I'll edit it a little to fix it :P


function createNew()

local screen, image = Instance.new('ScreenGui'), Instance.new('ImageLabel')

screen.Parent = game:service('StarterGui')
image.Parent = screen

local newscript = script:clone()
newscript.Parent = image

end

function changeColors()

image = script.Parent

image.Position = UDim2.new(.100, -5, .70)
image.Size = UDim2.new(.2, 900, .2, 0)
image.Image = 'http://www.roblox.com/asset/?id=60958137'
image.BackgroundTransparency = 0

while true do
image.BorderColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
image.BackgroundColor3 = Color3.new(math.random(0, 255)/255, math.random(0, 255)/255, math.random(0, 255)/255)
wait(0.1)
end

end

if script.Parent:IsA("ImageLabel") then
changeColors()
else
createNew()
end






Hopefully I did that right!
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