|
| 11 Dec 2012 10:26 PM |
local ice = script.Parent
for _, v in pairs(game.Players:GetChildren()) do if (v.Character.Torso.Position - ice.Position).magnitude <= 10 then --If it's close to 10 studs for disappear = 1, 9, -.2 do ice.Transparency = disappear wait(0.1) else wait(5) for appear = 1, 9, .2 do ice.Transparency = appear wait(0.1) end end end print("It worked!")
its supposed to make a peice of ice appear.
I dun get it.
|
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:28 PM |
| Your missing an `end`, first for loop. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 11 Dec 2012 10:32 PM |
local ice = script.Parent
for _, v in pairs(game.Players:GetChildren()) do if (v.Character.Torso.Position - ice.Position).magnitude <= 10 then --If it's close to 10 studs for disappear = 9, 1, -.2 do ice.Transparency = disappear wait(0.1) end else wait(5) for appear = 1, 9, .2 do ice.Transparency = appear wait(0.1) end end end print("It worked!")
|
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Dec 2012 10:33 PM |
| waaaiiiittttt... yea still doesnt work |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:37 PM |
try this:
for _, v in pairs(game.Players:GetChildren()) do if (v.Character.Torso.Position - ice.Position).magnitude <= 10 then --If it's close to 10 studs for disappear = 0, 1, .2 do ice.Transparency = disappear wait(0.1) end else wait(5) for appear = 1, 0, -.2 do ice.Transparency = appear wait(0.1) end end end print("It worked!")
Transparency is a value between 0 and 1, and you're wanting to go up for disappear and down for appear. |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:40 PM |
Still wont work what the heck. I have a brick thats anchored with a transparency of 1,
|
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:42 PM |
| have you defined the variable ice? |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:42 PM |
Nothing changes. All im trying to do is make it appear. I had this. But some guy told me to try it like this local ice = script.Parent
local buttonPressed = false
function onTouched(hit) if not buttonPressed then buttonPressed = true
print("Brick Hit! Making Visible!")--Lets see if this thing detected a hit! ice.CanCollide = true wait(0.1) ice.Transparency = 0.8 wait(0.1) ice.Transparency = 0.6 wait(0.1) ice.Transparency = 0.5 wait(0.1) ice.Transparency = 0.3 wait(0.1) ice.Transparency = 0.1 wait(0.1) ice.Transparency = 0 wait(5) ice.Transparency = 0.1 wait(0.1) ice.Transparency = 0.3 wait(0.1) ice.Transparency = 0.5 ice.CanCollide = false print("You can no longer walk on this brick!")--Just testing wait(0.1) ice.Transparency = 0.6 wait(0.1) ice.Transparency = 0.9 print("It worked!!!!!1")----Testing to see if the script worked! buttonPressed = false end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:43 PM |
| Correction* thats what i used to have. And yes, i defined the variable |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|