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 |
|
|
|
| 23 Nov 2014 11:26 PM |
| What is the class-names of script.Parent and script.Parent.Parent? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 21 Aug 2011 |
| Total Posts: 87 |
|
| |
|
jamdane22
|
  |
| Joined: 21 Aug 2011 |
| Total Posts: 87 |
|
| |
|
|
| 24 Nov 2014 05:12 PM |
| local chat = script.Parent.Parent ? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 24 Nov 2014 05:15 PM |
| Then you need 1 more Parent |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| Joined: 21 Aug 2011 |
| Total Posts: 87 |
|
|
| 25 Nov 2014 01:46 PM |
@Elite
I never learned how to read the output :/ |
|
|
| Report Abuse |
|
|
| |
|