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: Command Help

Previous Thread :: Next Thread 
mrdefender99 is not online. mrdefender99
Joined: 03 Feb 2011
Total Posts: 412
14 May 2012 02:33 PM
function onChatted(message,player)
if message:sub(1, 5) == "!kill" then
game.Players.Player.Character.Humanoid.MaxHealth = 0
end
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

I was expecting for all the players to get killed but no one did. Please help.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 May 2012 02:38 PM
Try:

Game.Players.PlayerAdded:connect(function(player)
  player.Chatted:connect(function(msg)
    if msg == "!kill" then
for i, v in pairs(Game.Players:GetPlayers()) do
if v.Character then
v.Character:BreakJoints()
   end
end
end
  end)
end)

† KMXD †
Report Abuse
mrdefender99 is not online. mrdefender99
Joined: 03 Feb 2011
Total Posts: 412
14 May 2012 02:40 PM
ok ok :3 Then how do I insert a backpack into all the players
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 May 2012 02:45 PM
Uh...

for _, b in pairs(Game.Players:GetPlayers()) do
Instance.new("Backpack", b)
end

???

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 May 2012 02:50 PM
Try:

Game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "LinkedSword" then
for i, v in pairs(Game.Players:GetPlayers()) do
if v.Character then
Instance.new("Backpack", v).Name = "Backpack2"
Game.Lighting:FindFirstChild("LinkedSword"):Clone().Parent = v.Backpack2
end
end
end
end)
end)

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 May 2012 03:08 PM
Okay, here's to not over-complicating things.

Game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "linked on" then
for i, v in pairs(Game.Players:GetPlayers()) do
Game.Lighting:FindFirstChild("LinkedSword"):Clone().Parent = v.StarterGear
end
elseif msg == "linked off" then
for i, v in pairs(Game.Players:GetPlayers()) do
v.StarterGear:FindFirstChild("LinkedSword"):Destroy()
end
end
end
end)
end)

Do the same for the gun.

† KMXD †
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