Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

textbut.MouseButton1Click:connect(function() not working? FIXED

Asked by
Oullim 0
8 years ago
textbut = script.Parent.Map

textbut.MouseButton1Click:connect(function()
if script.Parent.ScrollingFrame.Visible == true then
script.Parent.ScrollingFrame.Visible = false
textbut.Text = 'Open Map'
else
script.Parent.ScrollingFrame.Visible = true
textbut.Text = 'Close Map'
end
end)

I fixed it just a simple error with another script

1
What error do you get in the Output? DevChris 235 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

First of all, make sure it's a LocalScript. Second of all, when opening Guis, it's a lot more simple than that. Simply do;

textbut=script.Parent.Map

textbut.MouseButton1Click:connect(function()
    script.Parent.ScrolingFrame.Visible=not script.Parent.ScrollingFrame.Visible
end)

Turning an 11 line code to 5 lines.

Ad

Answer this question