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
 

Re: How come this isn't working?

Previous Thread :: Next Thread 
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:08 AM
game.Players.PlayerAdded:connect(function(player)
if player.name == "ToboboT" or player:GetRankInGroup(805236,12) >= 12 then
player.Chatted:connect(function (message)
if message == "run/door" then
local a = game.Workspace.Holo.Door
a.Transparency = 1
a.CanCollide = false
elseif message == "stop/door" then
local b = game.Workspace.Holo.Door
a.Transparency = .7
a.CanCollide = true
elseif message == "run/colors" then
local c = game.Lighting.Colors:clone()
c.Name = "Holo"
c.Parent = game.Workspace
elseif message == "run/koth" then
local d = game.Lighting.KOTH:clone()
d.Name = "Holo"
d.Parent = game.Workspace
elseif message == "run/gun" then
local e = game.Lighting.Gun:clone()
e.Name = "Holo"
e.Parent = game.Workspace
elseif message == "run/pokemon" then
local f = game.Lighting.Pokemon:clone()
f.Name = "Holo"
f.Parent = game.Workspace
local z,y = Instance.new("Team",game.Teams), Instance.new("Team",game.Teams)
z.TeamColor = Color.new("Bright green")
z.Name = "Green"
x.TeamColor = Color.new("Bright red")
x.Name = "Red"
elseif message == "run/sword" then
local g = game.Lighting.Sword:clone()
g.Name = "Holo"
g.Parent = game.Workspace
elseif message == "stop/" then
if game.Workspace:findFirstChild("Holo") then
game.Debris:AddItem(game.Workspace.Holo,.01)
if game.Teams:findFirstChild("Green") and game.Teams:findFirstChild("Red")then
game.Debris:AddItem(game.Teams.Green and game.Teams.Red,.01)
end
end
end
end)
end
end)



I know it is a lot but I think right here is the problem:

game.Players.PlayerAdded:connect(function(player)
if player.name == "ToboboT" or player:GetRankInGroup(805236,12) >= 12 then
player.Chatted:connect(function (message)


Please help
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:09 AM
Updated the 3 lines:

game.Players.PlayerAdded:connect(function(player)
if player.name == "ToboboT" or player:GetRankInGroup(805236) >= 12 then
player.Chatted:connect(function (message)
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
11 Jul 2013 02:09 AM
Didn't KnightmareXD already tell you to remove the second argument(12)?

player:GetRankInGroup(805236) >= 12 then
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
11 Jul 2013 02:10 AM
player.Name
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:11 AM
Yeah I updated it I was posting an old version. xP
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:11 AM
And thank you
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Jul 2013 02:11 AM
You have to captitlize the "n" in "name" for the .Name property.
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:14 AM
Plus in this it only works for one time so should I add a while wait() do after the checking the player?
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:15 AM
Like this?:


game.Players.PlayerAdded:connect(function(player)
if player.Name == "ToboboT" or player:GetRankInGroup(805236) >= 12 then
while wait() do
player.Chatted:connect(function (message)
if message == "run/door" then
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Jul 2013 02:16 AM
Hm, it shouldn't. Try putting the if statement in the .Chatted event? Perhaps it errors before finishing.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
11 Jul 2013 02:16 AM
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function (message)
if player.Name == "ToboboT" or player:GetRankInGroup(805236) >= 12 then
if message == "run/door" then
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:21 AM
Still no here is the script:


game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function (message)
if player.Name == "ToboboT" or player:GetRankInGroup(805236) >= 12 then
if message == "run/door" then
local a = game.Workspace.Holo.Door
a.Transparency = 1
a.CanCollide = false
elseif message == "stop/door" then
local b = game.Workspace.Holo.Door
a.Transparency = .7
a.CanCollide = true
elseif message == "run/colors" then
local c = game.Lighting.Colors:clone()
c.Name = "Holo"
c.Parent = game.Workspace
elseif message == "run/koth" then
local d = game.Lighting.KOTH:clone()
d.Name = "Holo"
d.Parent = game.Workspace
elseif message == "run/gun" then
local e = game.Lighting.Gun:clone()
e.Name = "Holo"
e.Parent = game.Workspace
elseif message == "run/pokemon" then
local f = game.Lighting.Pokemon:clone()
f.Name = "Holo"
f.Parent = game.Workspace
local z,y = Instance.new("Team",game.Teams), Instance.new("Team",game.Teams)
z.TeamColor = Color.new("Bright green")
z.Name = "Green"
x.TeamColor = Color.new("Bright red")
x.Name = "Red"
elseif message == "run/sword" then
local g = game.Lighting.Sword:clone()
g.Name = "Holo"
g.Parent = game.Workspace
elseif message == "stop/" then
if game.Workspace:findFirstChild("Holo") then
game.Debris:AddItem(game.Workspace.Holo,.01)
if game.Teams:findFirstChild("Green") and game.Teams:findFirstChild("Red")then
game.Debris:AddItem(game.Teams.Green and game.Teams.Red,.01)
end
end
end
end
end)
end)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Jul 2013 02:24 AM
Just skimming, but you can't do this:

game.Debris:AddItem(game.Teams.Green and game.Teams.Red,.01)

Try:

Game.Debris:AddItem(Game.Teams.Green, 0.01)
Game.Debris:AddItem(Game.Teams.Red, 0.01)
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:31 AM
Anything look out of the ordinary?
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
11 Jul 2013 02:37 AM
local z,y = Instance.new("Team",game.Teams), Instance.new("Team",game.Teams)
z.TeamColor = Color.new("Bright green")
z.Name = "Green"
x.TeamColor = Color.new("Bright red")
x.Name = "Red"

I changed a few things and this all worked except for this...

Is it Color3?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
11 Jul 2013 02:38 AM
BrickColor.new("")

Also, you used z and y, not z and x.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Jul 2013 02:38 AM
No, BrickColor.new("Bright green") and BrickColor.new("Bright red").

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