|
| 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 |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 04 Jan 2013 12:28 PM |
| What is this suppose to do? |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:33 PM |
| If Apart in girafffe9 is visible then it deletes giraffe1 (giraffe 1 is amodel) |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
| |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 04 Jan 2013 12:54 PM |
| Did you get something in the output? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 04 Jan 2013 12:56 PM |
| May i ask you what you changed? |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:58 PM |
| he moved the then from line 2 to line 1 and it did not work |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 12:59 PM |
| I wish you could talk when you were building. Then I could check the output. |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 04 Jan 2013 12:59 PM |
| Did you get anything form the output? |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 04 Jan 2013 01:00 PM |
| Ignore what i said about the output |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 Jan 2013 01:15 PM |
| How would I get it to recheck. Anybody know? |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 04 Jan 2013 01:18 PM |
| Remove one of the ==, try with one only. |
|
|
| Report Abuse |
|
|
| |
|