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 10 years ago

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

repeat wait() until game.Players.LocalPlayer
local mouse = game.Players.LocalPlayer:GetMouse()

local 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
local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
local Button = script.Parent --The script will most likely be in the button

function onClick()
if PopUpFrame.Visible == true then
    PopUpFrame.Visible = false

elseif PopUpFrame.Visible == false then
PopUpFrame.Visible = true
end 
end

Button.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 — 10y

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago
wait(5)
local player = game.Players.LocalPlayer
local mouse = Player:GetMouse()

local 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
local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
local Button = script.Parent --The script will most likely be in the button

function onClick()
if PopUpFrame.Visible == true then
    PopUpFrame.Visible = false

elseif PopUpFrame.Visible == false then
PopUpFrame.Visible = true
end 


Button.MouseButton1Click:connect(onClick)


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

Ad

Answer this question