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: Simple script won't work

Previous Thread :: Next Thread 
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 11:22 AM
My simple script won't work. I hope there is an easy fix.

function chat(msg)
local command = "poacher"
if string.sub(msg:lower(), 1, string.len(command)) == command then
for _,v in pairs(game.Workspace.Giraffe9:GetChildren())do
v.Transparency = 0
end
end
game.Players.PlayerAdded:connect(function(player)
if player.Name:lower() == "theuntimelydoctor" then
player.Chatted:connect(chat)
end
end)
end
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 11:27 AM
Bring

Up

My

Problem
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 11:32 AM
Need help...
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
04 Jan 2013 11:38 AM
function onChatted(msg, recipient, speaker)
if speaker.Name == "theuntimelydoctor" and string.lower(msg) == "poacher" then
for _,v in pairs(game.Workspace.Giraffe9:GetChildren())do
v.Transparency = 0
end
end
end

function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 11:46 AM
That works. But now I realize that this doesn't work...

pcall(function() if Workspace.Giraffe9.Apart.Transparency == 0
then for _,v in pairs(game.Workspace.Giraffe1:GetChildren())do
v:Destroy()
end
end
end)
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:02 PM
bump
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:26 PM
Please Help.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:28 PM
What is this suppose to do?
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:33 PM
If Apart in girafffe9 is visible then it deletes giraffe1 (giraffe 1 is amodel)
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:38 PM
pcall(function() if Workspace.Giraffe9.Apart.Transparency == 0
then for _,v in pairs(game.Workspace.Giraffe1:GetChildren())do
v:remove()
end
end
end)

-- i switched destroy to remove try it now.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:50 PM
Well did it work?
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:51 PM
testing one second...
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:54 PM
nope
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:54 PM
Did you get something in the output?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Jan 2013 12:55 PM
pcall(function() if Workspace.Giraffe9.Apart.Transparency == 0 then
for _,v in pairs(game.Workspace.Giraffe1:GetChildren())do
v:Destroy()
end
end
end)
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:56 PM
May i ask you what you changed?
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:58 PM
he moved the then from line 2 to line 1 and it did not work
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 12:59 PM
I wish you could talk when you were building. Then I could check the output.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 12:59 PM
Did you get anything form the output?
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 01:00 PM
Ignore what i said about the output
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 01:05 PM
Here is the funny thing.

One script makes it so when you say poacher all of giraffe9 becomes visible. THAT WORKS

The second script makes it so if Giraffe9.Apart is visible it deletes all of graffe1 THAT WORKS IF Giraffe9.Apart is visible at the beggining of the server but not if it becomes visible after the server is created. I wonder if it isn't re-checking.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
04 Jan 2013 01:10 PM
Something similar to that has happened to me its EXCRUCIATING!!!!
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 01:15 PM
How would I get it to recheck. Anybody know?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Jan 2013 01:18 PM
Remove one of the ==, try with one only.
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
04 Jan 2013 01:18 PM
Anyone?
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