yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:32 PM |
admins = {"thomaszand","Chris110000"}
function isPlayerAdmin(name) for i,v in pairs (admins) do if name == v then return true end end end
Does anyone know what is wrong?, i have no idea what is wrong... its just one command so far which is "kill/" but when i chat it it doesnt work :/ -------------------------------------------------------------------------- function Chatted(msg) if string.sub(msg,1,5) == "kill/" then local player = game.Players:FindFirstChild(string(msg,6)) if player then player.Character then player.Character.Humanoid.Health = 0 end end end end
function PlayerAdded(newplayer) if isPlayerAdmin(newplayer.Name) then newplayer.Chatted:connect(chatted) else print("Player is not admin!") end end
game.Players.PlayerAdded:connect(PlayerAdded)
|
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:33 PM |
OOPS!
Does anyone know what is wrong?, i have no idea what is wrong... its just one command so far which is "kill/" but when i chat it it doesnt work :/ -------------------------------------------------------------------------- admins = {"thomaszand","Chris110000"}
function isPlayerAdmin(name) for i,v in pairs (admins) do if name == v then return true end end end
function Chatted(msg) if string.sub(msg,1,5) == "kill/" then local player = game.Players:FindFirstChild(string(msg,6)) if player then player.Character then player.Character.Humanoid.Health = 0 end end end end
function PlayerAdded(newplayer) if isPlayerAdmin(newplayer.Name) then newplayer.Chatted:connect(chatted) else print("Player is not admin!") end end
game.Players.PlayerAdded:connect(PlayerAdded) |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
| |
|
|
| 13 Oct 2012 06:38 PM |
function Chatted(msg) if string.sub(msg,1,5) == "kill/" then local player = game.Players:FindFirstChild(string(msg,6)) if player then player.Character:BreakJoints() end end end end
http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information. |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:40 PM |
| going to test it, thanks :) |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:43 PM |
wait nvm i put my alt's name in there as admin sometimes i just think im so dumb :l |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Oct 2012 06:45 PM |
local player = game.Players:FindFirstChild(string(msg,6))
or
local player = game.Players:FindFirstChild(string.sub(msg,6)) |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
| |
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:52 PM |
this is what i have so far, i added both of your things but it still does not work :/ ------------------------------------------------------------------------------------------ admins = {"yanz12"}
function isPlayerAdmin(name) for i,v in pairs (admins) do if name == v then return true end end end
function Chatted(msg) if string.sub(msg,1,5) == "kill/" then local player = game.Players:FindFirstChild(string.sub(msg,6)) if player then player.Character:BreakJoints() end end end end
function PlayerAdded(newplayer) if isPlayerAdmin(newplayer.Name) then newplayer.Chatted:connect(chatted) else print("Player is not admin!") end end
game.Players.PlayerAdded:connect(PlayerAdded)
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Oct 2012 06:57 PM |
You're missing a return false
function isPlayerAdmin(name) for i,v in pairs (admins) do if name == v then return true end end return false end |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 06:59 PM |
k added, gonna test really hope it works :/ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Oct 2012 07:00 PM |
1 mroe thing -.- You added an extra END for the chatted function |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
| |
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
| |
|
|
| 13 Oct 2012 07:05 PM |
Freaking Jesus!
game.Players.PlayerAdded:connect(function(plr) if plr.Name == "yanz12" then plr.Chatted:connect(function(msg) if msg:sub(1,5) == "kill/" then plr = game.Players:FindFirstChild(msg:sub(6)) if plr then plr.Character:BreakJoints() end end end) end end)
http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information. |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:08 PM |
cease thats called copying and pasting i wont learn anything from it will i? my goal is to become a successfull scripter, not let others make different things for me
if i put that in i wont even understand what my script is and what each line does... |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2012 07:10 PM |
yanz thats called typing up a script why would i copy and paste it if it takes one minute? my goal is to help you, not let you fail and double post
if you dont understand it then tell me or try to learn it and look it up on the wiki...
http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information. |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:11 PM |
i havent learned about plr and all that stuff, so i dont know what that does if i dont know, i also cant add stuff ... |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:11 PM |
ok plr is player, i understand that but your code is different than mine :/ |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:13 PM |
i added it lets see if it works if it does ill try to figure it out |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:14 PM |
it does, thanks ill try to figure all the lines out 1 by one to understand the code |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2012 07:15 PM |
Have fun.
http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information. |
|
|
| Report Abuse |
|
|
yanz12
|
  |
| Joined: 15 Jun 2010 |
| Total Posts: 18576 |
|
|
| 13 Oct 2012 07:23 PM |
what i figured so far: -----------------------------------
game.Players.PlayerAdded:connect(function(plr) -- if a player is added it connects to function player
if plr.Name == "yanz12" then -- if the plr/player's name is "yanz12" then...
plr.Chatted:connect(function(msg) --- if yanz12 chats it connects to function "msg"
if msg:sub(1,5) == "kill/" then plr = game.Players:FindFirstChild(msg:sub(6)) -- when yanz12 chats "kill/" (idk the things after this)
if plr then plr.Character:BreakJoints() end -- if the player has chatted "kill/(person)" then it kills the player/Breaks its joints
end end) end end) -- ends the script
|
|
|
| Report Abuse |
|
|