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 » Game Design
Home Search
 

Re: Why doesnt this work.

Previous Thread :: Next Thread 
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
02 Apr 2015 12:51 PM
local isAdmin = {['Player'] = true,}
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "kill " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim.Character:BreakJoints()
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "kick " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim:Kick()
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "tool " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
local tool1 = Instance.new('HopperBin')
local tool2 = Instance.new('HopperBin')
local tool3 = Instance.new('HopperBin')
tool1.BinType = 'Hammer'
tool2.BinType = 'Clone'
tool3.BinType = 'Grab'
tool1.Parent = victim.Backpack
tool2.Parent = victim.Backpack
tool3.Parent = victim.Backpack
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "cmnds" and isAdmin[player.Name] then
local h = Instance.new('Hint',game.Workspace)
h.Text = 'Cmds: tool, kill, kick'
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message,player) end)
end)
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
02 Apr 2015 12:55 PM
edit:
local isAdmin = {['Player'] = true,}
function findPlayer(name)
for _,player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "kill " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim.Character:BreakJoints()
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "kick " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim:Destroy()
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "tool " and isAdmin[player.Name] then
local victim = findPlayer(message:sub(6))
if victim and victim.Character then
local tool1 = Instance.new('HopperBin')
local tool2 = Instance.new('HopperBin')
local tool3 = Instance.new('HopperBin')
tool1.BinType = 'Hammer'
tool2.BinType = 'Clone'
tool3.BinType = 'Grab'
tool1.Parent = victim.Backpack
tool2.Parent = victim.Backpack
tool3.Parent = victim.Backpack
end
end
end
function onChatted(message,player)
if message:sub(1,5) == "cmnds" and isAdmin[player.Name] then
local h = Instance.new('Hint',game.Workspace)
h.Text = 'Cmds: tool, kill, kick'
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message,player) end)
end)
Report Abuse
kingbeast786 is not online. kingbeast786
Joined: 27 Nov 2013
Total Posts: 2162
02 Apr 2015 01:03 PM
maybe try the scripters forum.


the thing about common sense is that it is not common.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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