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: Wow.. I'm suprised this doesn't work.

Previous Thread :: Next Thread 
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Mar 2014 04:53 PM
image = script.Parent
texture = script.Parent.Image
Image1 = "http://www.roblox.com/asset/?id=136485712"
Image2 = "http://www.roblox.com/asset/?id=24166543"
Image3 = "http://www.roblox.com/asset/?id=63760686"
Image4 = "http://www.roblox.com/asset/?id=53382802"
while true do
if texture = Image1 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position+Udim2.new(0, 1, 0, 0)
end
texture = Image2
if texture = Image2 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position-Udim2.new(0, 1, 0, 0)
end
texture = Image3
if texture = Image3 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position + Udim2.New(0, 1, 0, 0)
end
texture = Image4
if texture = Image4 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position - Udim2.new(0, 1, 0, 0)
end
end
end
end
end
end
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Mar 2014 04:54 PM
Error:
line 8: 'then' expected near '='

Thats what the output says, but there is a "Then" near '='

image = script.Parent
texture = script.Parent.Image
Image1 = "http://www.roblox.com/asset/?id=136485712"
Image2 = "http://www.roblox.com/asset/?id=24166543"
Image3 = "http://www.roblox.com/asset/?id=63760686"
Image4 = "http://www.roblox.com/asset/?id=53382802"
while true do
if texture = Image1 then -- Line 8, the problem.
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position+Udim2.new(0, 1, 0, 0)
end
texture = Image2
if texture = Image2 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position-Udim2.new(0, 1, 0, 0)
end
texture = Image3
if texture = Image3 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position + Udim2.New(0, 1, 0, 0)
end
texture = Image4
if texture = Image4 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position - Udim2.new(0, 1, 0, 0)
end
end
end
end
end
end
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
21 Mar 2014 04:56 PM
Hint: == is different from =
Report Abuse
zZxTheBuilderxZz is not online. zZxTheBuilderxZz
Joined: 26 Oct 2013
Total Posts: 89
21 Mar 2014 04:59 PM
Fix I hope:

image = script.Parent
texture = script.Parent.Image
Image1 = "http://www.roblox.com/asset/?id=136485712"
Image2 = "http://www.roblox.com/asset/?id=24166543"
Image3 = "http://www.roblox.com/asset/?id=63760686"
Image4 = "http://www.roblox.com/asset/?id=53382802"
while true do
if texture == Image1 then -- Line 8, the problem.
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position+Udim2.new(0, 1, 0, 0)
end
texture = Image2
if texture == Image2 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position-Udim2.new(0, 1, 0, 0)
end
texture = Image3
if texture == Image3 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position + Udim2.New(0, 1, 0, 0)
end
texture = Image4
if texture == Image4 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position - Udim2.new(0, 1, 0, 0)
end
end
end
end
end
end
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
21 Mar 2014 05:00 PM
Fixed.

image = script.Parent
texture = script.Parent.Image
Image1 = "http://www.roblox.com/asset/?id=136485712"
Image2 = "http://www.roblox.com/asset/?id=24166543"
Image3 = "http://www.roblox.com/asset/?id=63760686"
Image4 = "http://www.roblox.com/asset/?id=53382802"
while true do
if texture == Image1 then -- Remember, you must use == and not = with if statements.
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position+Udim2.new(0, 1, 0, 0)
end
texture = Image2
if texture = Image2 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position-Udim2.new(0, 1, 0, 0)
end
texture = Image3
if texture == Image3 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position + Udim2.New(0, 1, 0, 0)
end
texture = Image4
if texture = Image4 then
wait(10)
for i = 1, 201 do
wait(.01)
image.Position = Position - Udim2.new(0, 1, 0, 0)
end
end
end
end
end
end
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
21 Mar 2014 05:01 PM
you can define a variable as a property,but changing that variable doesn't change the property
take out "texture"

and change it to

if image.Image == Image1 then--etc
Report Abuse
zZxTheBuilderxZz is not online. zZxTheBuilderxZz
Joined: 26 Oct 2013
Total Posts: 89
21 Mar 2014 05:02 PM
The problem was that you used: if image = image1
1 = is for changing values
2 == is for checking values so...
if image == image1
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
21 Mar 2014 05:02 PM
And,in a "if" statement
if statement == true then--has to be "==" "==" means,is equal to
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
21 Mar 2014 05:04 PM
Remove the variable"texture"
And everywhere it says "texture" in the script
Change it to
image.Image
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