Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 04 Dec 2012 04:04 PM |
Hello there, can I have some help with the following script I am working on, I've checked it and I can't see any faults:
-- Aoredon's [1.0] Script --
Hint = Instance.new("Hint", Workspace) Hint.Text = " A[1.0]S " wait(2.5) Hint.Text = " LOADED " wait(2.5) Hint:Destroy()
-- CONFIG --
Owner = "Aoredon" -- The Player
Play = game.Players[Owner] Char = Play.Character Hum = Char.Humanoid
Friend = "GladiatorKing" -- The Friend
Play2 = game.Players[Friend] Char2 = Play2.Character Hum2 = Char2.Humanoid
-- FUNCTIONS --
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player end end end
-- COMMANDS --
function Commands(message, player)
if message:sub(1, 5) == "kill/" then victim = findPlayer(message:sub(6)) if victim and victim.Character then victim.Character:BreakJoints() end end end
-- END CONTENT --
game.Players.PlayerAdded:connect(function(player) if player.Name == Owner then player.Chatted:connect(function(message) Commands(message, player) end) end if player.Name == Friend then player.Chatted:connect(function(message) Commands(message, player) end) end end)
pcall(function() game.Players[Owner].Chatted:connect(Commands) end) pcall(function() game.Players[Friend].Chatted:connect(Commands) end)
|
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 04 Dec 2012 04:47 PM |
i do not like admin at script builders therefore i shall not help you
plus idk how |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 04 Dec 2012 05:37 PM |
I've seen this before.. well, something like it. Anyway, it won't work if only one of you is in this game, since you're using brackets, rather then the findFirstChild method. |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 02:23 AM |
(I recently lost all my data on computer so lost my old script too :P)
Thanks, I will try using this method :D Sounds like it will work anyway. You probably have seen it off the wikipedia in the admin commands section as I was using that as a guide for me to get off the ground, lol. |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 02:24 AM |
| Sorry for the double post, but morash, if you don't know how to script please don't post in here as I am only looking for help and I wish more people who could actually script played script builder instead of people who C&P scripts that other people have created and call it their own. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2012 02:35 AM |
You're making things hard for people. Try to make the script more clearer. Plus, everything are very simple based.
-- Aoredon's [1.0] Script --
Hint = Instance.new("Hint", Workspace) Hint.Text = " A[1.0]S " wait(2.5) Hint.Text = " LOADED " wait(2.5) Hint:Destroy()
-- CONFIG --
Commanders = {"Aoredon","GladiatorKing"}
-- FUNCTIONS --
function findPlayer(name) for _, player in ipairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player end end end
-- COMMANDS --
function Commands(message, player) if message:sub(1, 5) == "kill/" then victim = findPlayer(message:sub(6)) if victim then pcall(function() victim.Character:BreakJoints() end) end end
-- END CONTENT --
game.Players.PlayerAdded:connect(function(Player) pcall(function() Commanders[Player.Name].Chatted:connect(function(Chat) Commands(Chat,Player) end) end) end)
for i,v in pairs(Commanders) do pcall(function() Players[v].Chatted:connect(function(Chat) Commands(Chat,Player) end) end) end
--So, there you are. Simplified and fixed. What you did wrong is, you got an extra 'end' at the -- COMMANDS -- |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2012 06:35 AM |
| I am trying to learn how to script. Idk how, someone help me please... |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 09:24 AM |
Thank you for your help, I have it spaced out like that because it helps me understand instead of having a massive block of code (I don't know why, lol.)
@jamesbondjr6 Get ya own thread ;D |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 09:34 AM |
| I just checked the script and I didn't have an extra end.. If statements are supposed to have ends at the end of them ._. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2012 02:04 PM |
-- Aoredon's [1.0] Script --
Hint = Instance.new("Hint", Workspace) Hint.Text = " A[1.0]S " wait(2.5) Hint.Text = " LOADED " wait(2.5) Hint:Destroy()
-- CONFIG --
Commanders = {"Aoredon","GladiatorKing"}
-- FUNCTIONS --
function findPlayer(name) for _, player in ipairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player end end end
-- COMMANDS --
function Commands(message, player) if message:sub(1, 5) == "kill/" then victim = findPlayer(message:sub(6)) if victim then pcall(function() victim.Character:BreakJoints() end) end end end
-- END CONTENT --
game.Players.PlayerAdded:connect(function(Player) pcall(function() Commanders[Player.Name].Chatted:connect(function(Chat) Commands(Chat,Player) end) end) end)
for i,v in pairs(Commanders) do pcall(function() Players[v].Chatted:connect(function(Chat) Commands(Chat,Player) end) end) end
--Wait, what the *** --This should work maybe. |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 02:13 PM |
| Lol xD, let me give it a try :) |
|
|
| Report Abuse |
|
|
Aoredon
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 34 |
|
|
| 05 Dec 2012 02:16 PM |
| What the... It doesn't work? I'm really confused this script you have fixed for me should work ._. Yet it doesn't. |
|
|
| Report Abuse |
|
|