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
 

Little Help?

Previous Thread :: Next Thread 
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
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 is not online. 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
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
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
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
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
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
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
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
04 Jun 2013 11:33 PM
Le Bump

Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
05 Jun 2013 04:38 AM
Le B2

Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class
Report Abuse
LordOfNature99 is not online. LordOfNature99
Joined: 15 Dec 2011
Total Posts: 1867
05 Jun 2013 05:00 AM
Le bump spacho
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
05 Jun 2013 09:11 AM
b3

Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class
Report Abuse
MM54321NO1FAN is not online. MM54321NO1FAN
Joined: 11 Sep 2011
Total Posts: 1228
08 Jun 2013 07:41 AM
Wow, TG101 posted on this thread!
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