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
 

Is there a way to do this?

Previous Thread :: Next Thread 
Dominical is not online. Dominical
Joined: 04 Nov 2011
Total Posts: 1303
14 Apr 2014 08:56 PM
Where you can't take off hats or you die when you take off your hats?
Report Abuse
AmethystKnight is not online. AmethystKnight
Joined: 08 Apr 2014
Total Posts: 36
14 Apr 2014 08:58 PM
Kill the player when he presses that "=" key on the keyboard perhaps?
I don't know, I'm tired.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Apr 2014 08:58 PM
while wait() do
for I,v in pairs(game.Players:children()) do
char = v.Character or v.CharacterAdded:wait()
for _,h in pairs(char:children()) do
if h:IsA("Hat") then
h.Handle.Parent = char
h:Destroy()
end
end
end
end

--now no one can remove hats :P(will have to weld it tho)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
14 Apr 2014 08:59 PM
Game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character.ChildRemoved:connect(function(Item)
if Item:IsA("Hat") then
Item.Parent = Character
end
end)
end)
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Apr 2014 08:59 PM
while wait() do
for I,v in pairs(game.Players:children()) do
char = v.Character or v.CharacterAdded:wait()
for _,h in pairs(char:children()) do
if h:IsA("Hat") then
h.Handle.Parent = char
h:Destroy()
end
end
end
end

--now no one can remove hats :P(will have to weld it tho)

or,you could

Workspace.ChildAdded:connect(function(c)
if c:IsA("Hat") then
wait()
c:Destroy()
end
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Apr 2014 09:00 PM
@not

dang,thats a better idea..didn't even think of that XD

good job lol
Report Abuse
Dominical is not online. Dominical
Joined: 04 Nov 2011
Total Posts: 1303
14 Apr 2014 09:15 PM
Thanks guys, I came up with something that I like:

plr = game.Players.LocalPlayer
plrmouse = plr:GetMouse()


function onKeyDown(key)

if string.byte(key) == 61 then
plr.Character:BreakJoints()
end

end

plrmouse.KeyDown:connect(onKeyDown)
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