beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
|
| 06 Dec 2011 09:04 AM |
I got animation and studs.
How do I get it so that if a person haves more than 1 hat, then it removes the other hats? Shirt and pants remover too please.
I don't know how to make it, but if you want a example of what I'm thinking in bad scripting language, then it's down under.
onPlayerAdded(player) findfirstchild hat If there is more than 1 hat (fail) then random delete 1 hat wait(0.1) If there is more than 1 hat (fail) then wait(0.1) random delete 1 hat else end
I know that was a fail, but now you know what I'm thinking. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2011 09:11 AM |
game.Players.PlayerAdded:connect(function(plr) for _,v in pairs(plr.Character()) do if v:IsA("Hat") then v:remove() end end end)
I don't know how to remove all hats but 1.
~I'm old Greg!~ |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 06 Dec 2011 09:46 AM |
Maybe something like this? Sorry for any unnecessary things being done. A few hours of sleep, and waking up only a half hour ago does a bit to your head.
local hats = {}
game.Players.PlayerAdded:connect(function(np) np.CharacterAdded:connect(function(nc) local amt = 0 for _,v in pairs(nc:children()) do if v:IsA("Hat") then amt = amt + 1 table.insert(hats,v) end end if amt > 1 then local numhats = math.random(#hats) for _,v in pairs(hats) do if _ == numhats then v:remove() end end hats = {} end end) end) |
|
|
| Report Abuse |
|
|
beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
|
| 06 Dec 2011 09:57 AM |
| So does any of these actually work? |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 06 Dec 2011 09:59 AM |
Try it? Also, you have to either use Test>Start Server and Test>Start Player, or test this in an online server. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 06 Dec 2011 10:16 AM |
Whoops. Move the hat reset below that end. The other script will still work, though. Once, at least. Maybe it's a good idea to make the table local to the character. Let's do that!
game.Players.PlayerAdded:connect(function(np) np.CharacterAdded:connect(function(nc) local hats = {} local amt = 0 for _,v in pairs(nc:children()) do if v:IsA("Hat") then amt = amt + 1 table.insert(hats,v) end end if amt > 1 then local numhats = math.random(#hats) for _,v in pairs(hats) do if _ == numhats then v:remove() end end end hats = {} end) end) |
|
|
| Report Abuse |
|
|
beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
|
| 06 Dec 2011 10:23 AM |
| I tested it online, and the script didn't seem to work. |
|
|
| Report Abuse |
|
|
Y5X
|
  |
| Joined: 28 Nov 2011 |
| Total Posts: 154 |
|
|
| 06 Dec 2011 10:24 AM |
"I have animation ...."
What animation is there in an old game... |
|
|
| Report Abuse |
|
|
beeflord
|
  |
| Joined: 06 Jun 2009 |
| Total Posts: 3372 |
|
| |
|
Diebrox
|
  |
| Joined: 17 Sep 2009 |
| Total Posts: 4716 |
|
|
| 06 Dec 2011 02:10 PM |
| If you're trying to make it a real classic, no meshes, no hats, no shirts, no pants, no t-shirts, no decals |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 06 Dec 2011 02:16 PM |
| Well, T-shirts were a part of ROBLOX before I was. How classic is he trying to make it? :o |
|
|
| Report Abuse |
|
|
Diebrox
|
  |
| Joined: 17 Sep 2009 |
| Total Posts: 4716 |
|
|
| 06 Dec 2011 02:19 PM |
| I'd love if he made it like in 06.. |
|
|
| Report Abuse |
|
|