|
| 18 Feb 2013 01:40 AM |
This is the second time I'm posting this, since I accidentally posted this in the wrong category. :/
Alright, you may have seen my other old post about the AI, and if so, then I got that to work except for the final if statement, where the bricks stay still for 600 seconds. If not, here:
This script is inside a BoolValue called OrderValue. When one chats "Guard here bot.", the value of its parent (OrderValue) will be true for a fraction of a second. Then, it will be false.
Anything wrong here?
while true do script.Parent.Value = false wait(.01) game.Players.PlayerAdded:connect(function(player) player.Chatted:connect( function(msg) if msg == "Guard here bot." then if game.Workspace[player.Name].Humanoid ~= nil and ((((game.Workspace.AI.Torso.Position - game.Workspace[player.Name].Torso.Position).magnitude)^2) < 65) then
if player:IsInGroup(131688) then if player:GetRankInGroup(131688) > 1 then script.Parent.Value = true wait(1) script.Parent.Value = false end
end end end end) end) script.Parent.Value = false
end |
|
|
| Report Abuse |
|
|
| |
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 18 Feb 2013 02:53 AM |
No output?
Use ROBLOX's Remote Error Monitoring Script to see output online |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 03:18 AM |
| Well, I only skimmed to be quite honest and noticed an inefficiency. GetRoleInGroup() automatically allows the rank if it is higher than the necessary rank. So I've heard that is, I never actually used it. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 03:19 AM |
| GetRankInGroup*, Sorry. Tired. Forgot that GetRoleInGroup() returns a string. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 05:27 AM |
| Hmn, well, I just changed it a bit, and it's paritally working now. |
|
|
| Report Abuse |
|
|