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 » Scripters
Home Search
 

Re: I'm trying to somewhat animate a GUI.

Previous Thread :: Next Thread 
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
24 Jan 2016 11:02 PM
[title], but obviously it's not working. Nothing is happening when I test it and I get no errors.

--[[ variables ]]--
local bg = script.Parent
local border = bg.border
local tech = bg.techno
local studio = bg.studio
local player = game.Players.LocalPlayer

local phase = 1
local piece1, pos1 = bg.pulsePiece1, UDim2.new(0.005, 0, 0.01, 0)
local piece2, pos2 = bg.pulsePiece2, UDim2.new(0.005, 0, 0.9, 0)
local piece3, pos3 = bg.pulsePiece3, UDim2.new(0.945, 0, 0.9, 0)
local piece4, pos4 = bg.pulsePiece4, UDim2.new(0.945, 0, 0.01, 0)

--[[ functions ]]--
function editColor(piece)
while true do

if phase == 1 then
for i = 1, 85 do
piece.BackgroundColor3 = piece.BackgroundColor3 + Color3.new(i/85, 0, -(i/85))
wait()
end
phase = 2

elseif phase == 2 then
for i = 1, 85 do
piece.BackgroundColor3 = piece.BackgroundColor3 + Color3.new(-(i/85), i/85, 0)
wait()
end
phase = 3

elseif phase == 3 then
for i = 1, 85 do
piece.BackgroundColor3 = piece.BackgroundColor3 + Color3.new(0, -(i/85), i/85)
wait()
end
phase = 1

end

wait()
end
end

function rotatePiece(piece)
for i = 1, 90 do
piece.Rotation = piece.Rotation + i
wait()
end
end

function playIntroAnimation()
for i,v in pairs(getfenv()) do
if string.sub(i, 1, 5) == "piece" then
spawn(editColor(v))
spawn(rotatePiece(v))
end
end
end

player.CharacterAdded:connect(function()
wait()
playIntroAnimation()
end)

~ Sincerely, Duncan ~
Report Abuse
punkymonkies is not online. punkymonkies
Joined: 22 Dec 2013
Total Posts: 1229
24 Jan 2016 11:12 PM
It looks good to me. (I'm not that an expert in coding) Although the tech looks new to me (I'm new at scripting.. mind me. xD)

Maybe it's a spelling error? A upper case should not be there? Look for any errors you may have made.

I'm just trying to help. xP
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
24 Jan 2016 11:56 PM
@punky
There wasn't any spelling errors because there wasn't an error on the output.

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
25 Jan 2016 06:02 PM
Found the problem using a few tests; getfenv() doesn't work on local variables.

~ Sincerely, Duncan ~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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