|
Heya, My script to open the door worked but because I made it lower the transparency every 0.1 second if you kept clicking the button it would repeat that so I added a IntValue but now I cant get my script to work at all. Can someone help?
Doorv = script.Parent.Parent.DoorV
function myfunction()
if Doorv value == "1" then
script.Parent.Parent.Door.Transparency = 0
wait(0.1)
script.Parent.Parent.Door.Transparency = 0.1
wait(0.1)
script.Parent.Parent.Door.Transparency = 0.3
wait(0.1)
script.Parent.Parent.Door.Transparency = 0.5
wait(0.1)
script.Parent.Parent.Door.Transparency = 0.7
script.Parent.Parent.Door.CanCollide = false
Doorv.Value = "0"
end
script.Parent.ClickDetector.MouseClick:connect(myfunction) |
|
dino2306Join Date: 2009-08-18 Post Count: 1964 |
line 2 : doorv value (No dot And lower cased first letter V) |
|
dino2306Join Date: 2009-08-18 Post Count: 1964 |
Oh and remove the "" those make a string , its also bugging you can input numbers as a number (like IntValue.Value = 1) |
|
DangCoolJoin Date: 2010-04-27 Post Count: 5568 |
[ Content Deleted ] |
|
DangCoolJoin Date: 2010-04-27 Post Count: 5568 |
[ Content Deleted ] |
|
|
Doorv = script.Parent.Parent.DoorV
function myfunction()
if Doorv.Value == "1" then
for i = 0, 1, 0.1 do
Doorv.Transparency = i
wait()
end
script.Parent.Parent.Door.CanCollide = false
wait(2)
for i = 0, 1, 0.1 do
Doorv.Transparency = Doorv.Transparency - 0.1
wait()
end
Doorv.Value = "0"
end
end |
|
dino2306Join Date: 2009-08-18 Post Count: 1964 |
@Dragon it works now?
if not , remove the "" between the numbers |
|
DangCoolJoin Date: 2010-04-27 Post Count: 5568 |
[ Content Deleted ] |
|
|
Doorv = script.Parent.Parent.DoorV
function myfunction()
if Doorv.Value == 1 then
for i = 0, 1, 0.1 do
Doorv.Transparency = i
wait()
end
script.Parent.Parent.Door.CanCollide = false
wait(2)
for i = 0, 1, 0.1 do
Doorv.Transparency = Doorv.Transparency - 0.1
wait()
end
Doorv.Value = 0
script.Parent.Parent.Door.CanCollide = true
end
end |
|
|
|
@Dang
No...
I already HAD the end.
Look up on it. |
|
DangCoolJoin Date: 2010-04-27 Post Count: 5568 |
[ Content Deleted ] |
|
DangCoolJoin Date: 2010-04-27 Post Count: 5568 |
[ Content Deleted ] |
|
|
Ok thanks but can someone explain to me how "for i = 0, 1, 0.1 do
Doorv.Transparency = i " works as I want to also use this type of script for my close button and I need to know how to edit. and would I change the "0.1" to "0.7" if I want it to be 0.7 transparency at the end? |
|
|
@Cj
No.
0.1 is increasing as that much, So I did it .5 time, as 0, 0.5, 0.1
Then the brick will increase the transparency of 0.1 by 5 time, then it'll be half transparent.
You can change 0, 1, 0.1 to 0, 0.7, 0.1 if you want to. |
|
|
and how would I do that method to make the door go down to 0 transparency? would it go "0.7, 0.7, 0.1" |
|
|
Doorv = script.Parent.Parent.DoorV
function myfunction()
if Doorv.Value == 1 then
for i = 0, 0.7, 0.1 do
Doorv.Transparency = i
wait()
end
script.Parent.Parent.Door.CanCollide = false
wait(2)
for i = 0, 0.7, 0.1 do
Doorv.Transparency = Doorv.Transparency - 0.1
wait()
end
Doorv.Value = 0
script.Parent.Parent.Door.CanCollide = true
end
end
That should solve the problem. |
|
|
I put the script it and the only bit working is the changing of CanCollide as it wont change the transparency... |
|