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 best script...

Previous Thread :: Next Thread 
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
07 Aug 2012 11:19 PM
debounce = false

function onTouched(Hit)
if debounce == false then
for i = 10, 100, 10 do
debounce = true
wait(0.15)
script.Parent.Transparency = script.Parent.Transparency +0.1
end
script.Parent.CanCollide = false
wait (5)
for i = 10, 100, 10 do
wait(0.15)
script.Parent.Transparency = script.Parent.Transparency -0.1
end
script.Parent.CanCollide = true
debounce = false
end
end

script.Parent.Touched:connect(onTouched)



I'm proud of myself ;'D


Is this hard for you?
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:22 PM
well you're being a little bit excessive with the numeric for loops. you could just go for i = 1, 10 do

and this is pretty basic for me. it creates a neat effect though. nice job.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:24 PM
Instead of this line:
script.Parent.Transparency = script.Parent.Transparency +0.1
Try:
script.Parent.Transparency = i/100
;3
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
07 Aug 2012 11:26 PM
@doom

I thoguht 10, 100, 10 and 1, 10, 1 was the same. Thanks :D

@mama

MAMA?!?!? O___o? OHAI :D!
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:27 PM
it is the same.

also if you don't provide a third parameter for the numeric for loop then it is automatically set to 1.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:29 PM
Hey :3
They basically are, the only difference is the numbers.
I would personally do it like so:
for i=0, 1, 0.1 do
script.Parent.Transparency = i
wait(.15)
end
for i=1, 0, -0.1 do
script.Parent.Transparency = i
wait(.15)
end
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
07 Aug 2012 11:29 PM
@doom

So, '10, 100, 10 do' will make something 10 times, meanwhile '10, 100 do' Will make something 90 times? =D!
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:29 PM
@Sal,
100 times :P
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:30 PM
yeah
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:30 PM
91 times i think
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:34 PM
???
No it would do it 100 o.O
for i=1, 100 --from 1, counting by 1, to 100
print(i)
wait()
end
Would print
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
DEDICATION, SON!
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:37 PM
that would be for i = 1, 100 do

he said for i = 10, 100
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:39 PM
ohhhh
failll
i wrote all those for nothing D:
And yes, 90 times, not 91
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:40 PM
actually it's 91

1, 100 does it 100 times, so naturally 10, 100 does it 91 times
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:42 PM
I'm pretty sure that 100 - 10 is 90
But okay.
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:42 PM
and 100 - 1 is 100 amirite
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Aug 2012 11:45 PM
......
In studio:
I have this script:
for i=10, 100 do
print(i)
wait()
end
output:
11-100
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 11:51 PM
i don't know about you bro but i got 10-100
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
08 Aug 2012 08:25 PM
bro the system is fooling us
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