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

Can AnyBody Help Me with this Script?

Asked by 11 years ago

I put this in my textbutton and it didnt work idk why

01repeat wait() until game.Players.LocalPlayer
02local mouse = game.Players.LocalPlayer:GetMouse()
03 
04local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put
05local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
06local Button = script.Parent --The script will most likely be in the button
07 
08function onClick()
09if PopUpFrame.Visible == true then
10    PopUpFrame.Visible = false
11 
12elseif PopUpFrame.Visible == false then
13PopUpFrame.Visible = true
14end
15end
16 
17Button.MouseButton1Click:connect(onClick)
0
You don't need the first 2 lines..and if this is a localscript then just put it in a regular script..and remove all the 'local's before the variables named. dyler3 1510 — 11y

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
11 years ago
01wait(5)
02local player = game.Players.LocalPlayer
03local mouse = Player:GetMouse()
04 
05local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put
06local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
07local Button = script.Parent --The script will most likely be in the button
08 
09function onClick()
10if PopUpFrame.Visible == true then
11    PopUpFrame.Visible = false
12 
13elseif PopUpFrame.Visible == false then
14PopUpFrame.Visible = true
15end
16 
17 
18Button.MouseButton1Click:connect(onClick)

repeat wait() until game.Players.LocalPlayer (Unnecessary) Just use waitfordataready() k.

Ad

Answer this question