NindoBoy
|
  |
| Joined: 09 Aug 2011 |
| Total Posts: 12860 |
|
| |
|
|
| 20 Mar 2012 08:31 PM |
Eh, why not.
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Hint") then v:Destroy() end end
† KMXD † |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 20 Mar 2012 08:38 PM |
Or....
if game.Workspace:FindFirstChild("Hint")~=nil then game.Workspace.Hint:Destroy() end
Will work if the hints name is Hint..
|
|
|
| Report Abuse |
|
|
|
| 20 Mar 2012 08:40 PM |
@Miz
Two problems,
1) Multiple hints. 2) Hints are named "Message" often.
:P
† KMXD † |
|
|
| Report Abuse |
|
|
sekots22
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 219 |
|
|
| 20 Mar 2012 08:43 PM |
| @KNIGHT; What about... if there is more than one hint, you would be able to list the possible names of the hints in a Table or string, correct? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 20 Mar 2012 08:44 PM |
1) Hmm. Didn't think of that :l
2)
if game.Workspace:FindFirstChild("Hint") ~=nil and game.Workspace.Hint.ClassName == "Hint" or game.Workspace.Hint.ClassName == "Message" then
Happy?
You know, let me just say this.
for i,v in next, Workspace:GetChildren() do if v:IsA("Hint") then v:Destroy() end end
|
|
|
| Report Abuse |
|
|
|
| 20 Mar 2012 08:46 PM |
@Sek
Mine would already destroy all the hints in Workspace.
@Miz
Well I don't know about next, so I'm going to assume it's correct. Though, mine was already done. :P
† KMXD † |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 20 Mar 2012 08:55 PM |
@Miz
About the "next" thing? Then yes, although, I think it is similar to ipairs(?) or something.
† KMXD † |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 20 Mar 2012 09:32 PM |
@miz
2 issues.
1) GetChildren isn't recursive. If the hints are in ANYTHING (I guarantee that they are - it would be as trivial as removing them with the explorer if they weren't).
2) Hinter-Scripts (What the TC wants to remove, the "The maker of this map...") recreate these hints when destroyed.
The answer to the TC is it's more complicated than a 3 line script; there isn't a good way to do it (either you effectively remove an entire class, or you risk letting some through) other than don't use free models. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 20 Mar 2012 09:36 PM |
Oh, really? Good to know.
How would I use next in this situation with the for loop? |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 20 Mar 2012 09:37 PM |
You can't use one for loop.
You need a recursive function. |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2012 09:46 PM |
I think this would work:
function destroyAll(type, area) for i,v in pairs(area:GetChildren()) do if v:IsA(type) then v:Destroy() else destroyAll(type, v) end end end
destroyAll("Hint", workspace)
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 20 Mar 2012 11:26 PM |
while game:FindFirstChild("Hint",true) do game:FindFirstChild("Hint",true):Destroy() end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2012 12:11 AM |
| :o Hints aren't usually in Data Model 'game'. I don't even think they show up there. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 21 Mar 2012 04:03 PM |
| i have hints in game. umadbro? |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2012 04:11 PM |
| You could find the message in a script,or try something other if you have many many many scripts and loads of code.Since I don't open scripts because i am a horrible scripter,also,i dont look at scripts.(i will be,and copying parts off them to learn how to script) |
|
|
| Report Abuse |
|
|