Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This LocalScript works for the first time but doesn't work for the second time?

It works, when I click it does show up with the popup if fccheck.value == false however if I try clicking the TextButton again it gives me this

Stack Begin Script 'Players.ShiforRBLX.PlayerGui.sfcGUI.frameTwo.fcBtn.LocalScript', Line 18 Stack End

here is the script

local plr = game.Players.LocalPlayer
local fccheck = plr.FCCHECK
local bccheck = plr.BCCHECK
local fctool = game.ServerStorage.Card
local fctoolclone = fctool:Clone()
local main = script.Parent.Parent.Parent.frameOne
local sec = script.Parent.Parent.Parent.frameTwo
local three = script.Parent.Parent.Parent.frameThree


script.Parent.MouseButton1Click:connect(function(player)
	if fccheck.Value == true then
		fctoolclone.Parent = plr.Backpack
		sec.Visible = false
		three.Visible = true
	elseif
		fccheck.Value == false then
		sec.popup.Visible = true
	end
end)

1 answer

✓ Accepted answer

Hello, ShiforRBLX!

You made a little mistake on lines 16 and 17

local plr = game.Players.LocalPlayer
local fccheck = plr.FCCHECK
local bccheck = plr.BCCHECK
local fctool = game.ServerStorage.Card
local fctoolclone = fctool:Clone()
local main = script.Parent.Parent.Parent.frameOne
local sec = script.Parent.Parent.Parent.frameTwo
local three = script.Parent.Parent.Parent.frameThree


script.Parent.MouseButton1Click:connect(function(player)
    if fccheck.Value == true then
        fctoolclone.Parent = plr.Backpack
        sec.Visible = false
        three.Visible = true
    elseif fccheck.Value == false then -- This must be on the same line!
        sec.popup.Visible = true
    end
end)

Good Luck with your games!

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.