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: I'm making a old roblox game...

Previous Thread :: Next Thread 
beeflord is not online. 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
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
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 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
06 Dec 2011 09:14 AM
[ Content Deleted ]
Report Abuse
grimm343 is not online. 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 is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
06 Dec 2011 09:57 AM
So does any of these actually work?
Report Abuse
grimm343 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
06 Dec 2011 01:47 PM
bumpedibum
Report Abuse
Diebrox is not online. 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 is not online. 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 is not online. 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
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