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: whats a script to remove hints

Previous Thread :: Next Thread 
NindoBoy is not online. NindoBoy
Joined: 09 Aug 2011
Total Posts: 12860
20 Mar 2012 08:30 PM
yea...
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Mar 2012 08:40 PM
@Miz

Two problems,

1) Multiple hints.
2) Hints are named "Message" often.

:P

† KMXD †
Report Abuse
sekots22 is not online. 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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Mar 2012 08:51 PM
@Knightmare

Really?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Mar 2012 08:55 PM
It's similar to pairs.
Report Abuse
swmaniac is not online. 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 is not online. 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 is not online. 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
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
20 Mar 2012 10:07 PM
LOl
13337 posts :P
Report Abuse
nate890 is not online. 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
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
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 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
21 Mar 2012 04:03 PM
i have hints in game. umadbro?
Report Abuse
shadownukepie is not online. shadownukepie
Joined: 03 Nov 2011
Total Posts: 390
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
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