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 » Scripters
Home Search
 

Re: Unknown Problem, Small Script

Previous Thread :: Next Thread 
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
23 Nov 2014 10:15 PM
local chat = script.Parent.Parent.On
db = false

local player = game.Players.LocalPlayer

Layout:
ScreenGui
-Frame
--On (A boolvalue that is set to false)
--ChatOn (TextButton)
---LocalScript (Script below)


LocalScript:

local chat = script.Parent.Parent.On
db = false

script.Parent.MouseButton1Click:connect(function()
if db == false then
db = true
chat.Value = true
wait(1)
player.Chatted:connect(function(chatmsg)
if chatmsg == "End" then
chat.Value = false
db = false
elseif chatmsg ~= "End" then
if chat.Value == true then
game.Workspace.Message.Text = chatmsg
wait(3)
game.Workspace.Message.Text = ""
end
end
end)
end
end)
Report Abuse
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
23 Nov 2014 11:26 PM
What is the class-names of script.Parent and script.Parent.Parent?
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 01:53 PM
The class-names were mentioned in the layout:

script.Parent = Textbutton

script.Parent.Parent = Frame
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 03:04 PM
Bump
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 05:06 PM
Bump
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
24 Nov 2014 05:12 PM
local chat = script.Parent.Parent ?
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 05:13 PM
@Elite

It's script.Parent.Parent.On which is the bool value
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
24 Nov 2014 05:15 PM
Then you need 1 more Parent
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 05:16 PM
@Elite

It doesn't need another Parent, just read the layout
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
24 Nov 2014 05:22 PM
Maybe the layout will be easier to read this way:


ScreenGui
>Frame(Frame)

>>ChatOn(TextButton)
>>>LocalScript(The script on the main post)

>>On(A BoolValue that is set to false)
Report Abuse
Fossick is not online. Fossick
Joined: 28 Dec 2008
Total Posts: 34839
24 Nov 2014 05:46 PM
Most likely, saying script.Parent.Parent = Frame is wrong

I would tell you to use

script.Parent.Parent.Classname = "Frame", but that's not allowed...

have you tried using the IsA() function??

if script.Parent.Parent:IsA("Frame") then...


R$93,535
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
25 Nov 2014 10:25 AM
Ok my bad, any output?
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
25 Nov 2014 01:45 PM
@Foss

That wasn't a line in the script, the other guy just asked what the script.Parent.Parent was; I was just letting him know it was a frame.
Report Abuse
jamdane22 is not online. jamdane22
Joined: 21 Aug 2011
Total Posts: 87
25 Nov 2014 01:46 PM
@Elite

I never learned how to read the output :/
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
25 Nov 2014 03:57 PM
Click View, then Output
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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