|
| 04 Jun 2013 07:30 AM |
I created a Prototype Armor. I've been thinking of a way to get the armor on me, in case I'm far from the Morpher. I came up with using OnChatted functions, I read about it in the wiki, and it turned out to be as easy as pie. However, the following script doesn't work. I also have no Output Errors.
local admins = {"Wreckerbuster67"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(msg, plr) local SubjectMain=msg:find("Suit",1,true) local KeyWordMain=msg:find("Get me",1,true) local Subject1=msg:find("Mk I",1,true) if SubjectMain and KeyWordMain and tableContains(admins, player.Name) or Subject1 and KeyWordMain and tableContains(admins, player.Name) then local NewArmor=game.Workspace:findFirstChild("Mk I"):clone() NewArmor.Parent=game.Workspace[plr] local ArmorTool=game.Lighting:findFirstChild("Mk I"):clone() ArmorTool.Parent=plr.Backpack local Content=NewArmor:GetChildren() for a=1, #Content do local parts=Content[a] local Weld=Instance.new("Weld") Weld.Part0=parts Weld.Part1=Content[a] Weld.C0=parts.CFrame:inverse() Weld.C1=Content[a].CFrame:inverse() Weld.Parent=parts parts.Anchored=false parts.CanCollide=false end end end
game.Players.PlayerAdded:connect(function(plr) player.Chatted:connect(function(msg) onChatted(msg, plr) end) end)
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
|
| 04 Jun 2013 07:33 AM |
"player.Chatted:connect(function(msg) onChatted(msg, plr) end)"
player is a nil value |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2013 07:49 AM |
@Woof Fixed that part. Still no Output, not working too.
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2013 09:05 AM |
You did it again here in the chatted function :
"if SubjectMain and KeyWordMain and tableContains(admins, player.Name) or Subject1 and KeyWordMain and tableContains(admins, player.Name) then" |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2013 10:06 PM |
@TG101 Fixed that already, still nothing.
Upadated script: (So no one else gets confused. :3)
local admins = {"Wreckerbuster67"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(msg, plr) local SubjectMain=msg:find("Suit",1,true) local KeyWordMain=msg:find("Get me",1,true) local Subject1=msg:find("Mk I",1,true) if SubjectMain and KeyWordMain and tableContains(admins, plr.Name) or Subject1 and KeyWordMain and tableContains(admins, plr.Name) then local NewArmor=game.Workspace:findFirstChild("Mk I"):clone() NewArmor.Parent=game.Workspace[plr] local ArmorTool=game.Lighting:findFirstChild("Mk I"):clone() ArmorTool.Parent=plr.Backpack local Content=NewArmor:GetChildren() for a=1, #Content do local parts=Content[a] local Weld=Instance.new("Weld") Weld.Part0=parts Weld.Part1=Content[a] Weld.C0=parts.CFrame:inverse() Weld.C1=Content[a].CFrame:inverse() Weld.Parent=parts parts.Anchored=false parts.CanCollide=false end end end
game.Players.PlayerAdded:connect(function(plr) player.Chatted:connect(function(msg) onChatted(msg, plr) end) end)
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2013 11:33 PM |
Le Bump
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 04:38 AM |
Le B2
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Jun 2013 09:11 AM |
b3
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2013 07:41 AM |
| Wow, TG101 posted on this thread! |
|
|
| Report Abuse |
|
|