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: Issue

Previous Thread :: Next Thread 
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
13 Aug 2013 01:11 PM
Ok on this script i really do not know what the problem is. i am getting no output, THe problem is when i click the gui it works but it only makes 1 of the hats i am wearing invisible then 5 seconds later it will come back but another hat will become invisible. I do not know how to fix this. All i want it to do is Make all the hats i am wearing invisible then 5 seconds later they all become visible again. and done
-------------------------------------------

function Remove()
local player = script.Parent.Parent.Parent.Parent.Parent.Character
for i,v in pairs(player:GetChildren()) do
if v.ClassName == "CharacterMesh" or v.ClassName == "Hat" then
v.Handle.Transparency = 1
wait(5)
v.Handle.Transparency = 0
end
end
end

script.Parent.MouseButton1Down:connect(Remove)
----------------------------------------------
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
13 Aug 2013 01:13 PM
function Equip()
for i,v in ipairs(game.Players:children()) do if script:IsDescendantOf(v) then plr = v
repeat wait() until plr.Character
char = plr.Character
for i,v in pairs(char:GetChildren()) do
if v:IsA("Hat") then v.Handle.Transparency = 1 end
end
for i,v in pairs(char:GetChildren()) do
wait(60) --Change to how long to keep it transparent
if v:IsA("Hat") then v.Handle.Transparency = 0 end
end
end
end
end
script.Parent.MouseButton1Down:connect(Equip)
Report Abuse
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
13 Aug 2013 01:15 PM
The line to make it re-appear is not making it reappear
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
13 Aug 2013 01:15 PM
It should work
Report Abuse
fireheart568 is not online. fireheart568
Joined: 04 Jan 2009
Total Posts: 1285
13 Aug 2013 01:16 PM
function Remove()
local player = script.Parent.Parent.Parent.Parent.Parent.Character
playerc = player:GetChildren
for i=1, #playerc do
object = playerc[i]
if object.ClassName == "CharacterMesh" or object.ClassName == "Hat" then
object.Handle.Transparency = 1
end
wait(5)
for i=1, #playerc do
object = playerc[i]
if object.ClassName == "CharacterMesh" or object.ClassName == "Hat" then
object.Handle.Transparency = 0
end
end
end
end

script.Parent.MouseButton1Down:connect(Remove)

This should work
Report Abuse
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
13 Aug 2013 01:17 PM
@Fire your does not work completly.

And the other script works fine but it just wont make the hats re-appear
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
13 Aug 2013 01:19 PM
^
It has a 60 second wait
Report Abuse
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
13 Aug 2013 01:19 PM
Ik. I am waiting 60 seconds and i have been. it wont re-apear
Report Abuse
djboy is not online. djboy
Joined: 16 Mar 2008
Total Posts: 794
13 Aug 2013 01:24 PM
I have got it working. you put the wait(60) in the wrong spot. This is how it should be



------------------
function Equip()
for i,v in ipairs(game.Players:children()) do if script:IsDescendantOf(v) then plr = v
repeat wait() until plr.Character
char = plr.Character
for i,v in pairs(char:GetChildren()) do
if v:IsA("Hat") then v.Handle.Transparency = 1 end
end
wait(60)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Hat") then v.Handle.Transparency = 0 end
end
end
end
end
script.Parent.MouseButton1Down:connect(Equip)
-----------------------
but thanks bro couldent have done it with out u
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