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: So, this doesnt work.

Previous Thread :: Next Thread 
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
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
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
11 Dec 2012 10:28 PM
Your missing an `end`, first for loop.
Report Abuse
miz656 is not online. 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
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 10:33 PM
odd, still doesnt work
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 10:33 PM
waaaiiiittttt... yea still doesnt work
Report Abuse
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
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
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
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
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
11 Dec 2012 10:42 PM
have you defined the variable ice?
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
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
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 10:43 PM
Correction* thats what i used to have. And yes, i defined the variable
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 10:47 PM
Bump
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 10:50 PM
I need help!
Report Abuse
MrParkwizard is not online. MrParkwizard
Joined: 28 Feb 2011
Total Posts: 679
11 Dec 2012 11:07 PM
bumpidge of help!
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