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: Can Someone debug this tool script?

Previous Thread :: Next Thread 
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 12:58 PM
locals = game.Players:GetChildren()
equip = false


function chat(msg)
if equip ~= false then
for i=1,#locals do
if locals[i].Backpack:FindFirstChild("Radio") ~= nil then
instance.new("Hint", locals[i].PlayerGui).Text = msg
wait(1)
locals[i].PlayerGui.Message:Destroy()
end
end
end
end

script.Parent.Equipped:connect(function ()
equip = true
end)

script.Parent.Unequipped:connect(function ()
equip = false
end)

script.Parent.Parent.Parent.Chatted:connect(chat)

The problem: It doesnt work. There's no output.
Report Abuse
koen500 is not online. koen500
Joined: 23 Feb 2011
Total Posts: 2277
18 Aug 2012 01:04 PM
What do you mean with debug?
A reload time?
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 01:04 PM
de·bug/dēˈbəg/
Verb:
Identify and remove errors from (computer hardware or software).
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
18 Aug 2012 01:13 PM
Is it creating the Hint inside the PlayerGui?
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 01:24 PM
I wouldn't know. You can't test the .Chatted event in test mode.
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
18 Aug 2012 01:27 PM
Just a quick look,

"instance.new("Hint", locals[i].PlayerGui).Text = msg"

Instance should be capitalized.

Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 01:30 PM
@Shobobo99 I missed that, but it still doesn't work. I cant seem to figure it out...
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 01:37 PM
bump
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
18 Aug 2012 01:39 PM
Here's a problem. Your script creates the players table when the player joins, so any new players that join will not receive the message. Does the message get displayed to yourself?
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 01:42 PM
Not even to myself. I was also thinking that what you said will happen too. What do you think I should do?
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
18 Aug 2012 02:06 PM
Oh, here we are.

"if locals[i].Backpack:FindFirstChild("Radio") ~= nil then"

You are checking the BACKPACK when what you really want is to check the CHARACTER, because when tools become equipped they parent to the character.

locals = game.Players:GetPlayers() -- this will fix your new player issue
for i=1,#locals do
if locals[i].Character and locals[i].Character:FindFirstChild("Radio") then -- check if character exists, then if Radio is equipped
local h = Instance.new("Hint", locals[i]:FindFirstChild("PlayerGui"))
h.Text = msg
wait(1)
h:Destroy()
end
end

The reason I made the hint a variable was to make sure that the hint you are removing is the one you created (in case of multiple messages).
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
18 Aug 2012 02:07 PM
So that is to go inside the Chat function.
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 02:17 PM
I want it to display to everyone else in possession of the radio, even when it's not equipped.
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 02:21 PM
Also, the changes you made didnt work.
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 02:42 PM
bump
Report Abuse
koen500 is not online. koen500
Joined: 23 Feb 2011
Total Posts: 2277
18 Aug 2012 03:34 PM
You can test that event.

Typ in command bar.
game.Players.Player:SetSuperSafeChat(false)
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 03:51 PM
All I'm getting is this:
15:49:17 - attempt to call a nil value
15:49:17 - Disconnected event because of exception
Report Abuse
rockintyler8 is not online. rockintyler8
Joined: 04 Jun 2011
Total Posts: 2050
18 Aug 2012 04:24 PM
I SOLVED IT MYSELF! YAY!
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