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

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

Asked by 6 years ago

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

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago

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!

0
Thanks! ShiforRBLX 5 — 6y
Ad

Answer this question