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

How can i fix this, no errors im not sure whats happening?

Asked by 4 years ago
Edited 4 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
local Blacksaber = script.Parent.Parent.Parent.Sabers:WaitForChild("Black Saber")
local Whitesaber = script.Parent.Parent.Parent.Sabers:WaitForChild("White Saber")

function Unlock()
    if Blacksaber.Bought.Value == true then
        script.Parent.Visible = false
        Whitesaber.TextButton.Visible = true
    else
        print("You dont have this Saber!")
     end
end

What im trying to achieve here is im trying to make it so if the Black Saber.Boughts value is true then the scripts parent is visible and the White Saber .TestButton is visible but everything works except these lines: script.Parent.Visible = false Whitesaber.TextButton.Visible = true else print("You dont have this Saber!") end end

0
If theres no errors. Then there aren't any syntax problems. What is the thing your trying to do whit your script? Skydoeskey 108 — 4y
0
-- im trying to make it so if blacksaber.bought.value is true then the scripts parent is not visible and the whitesaber.textbutton is visible but everything works but the two lines -- script.Parent.Visible = false -- Whitesaber.TextButton.Visible = true Toastitions 11 — 4y
0
do not work properly Toastitions 11 — 4y
1
Where do you call the function "lol"? You need to describe in detail what you're trying to accomplish and how your script is set up. Please use the edit feature to do so. M39a9am3R 3210 — 4y
0
edited Toastitions 11 — 4y

2 answers

Log in to vote
0
Answered by
karlo_tr10 1233 Moderation Voter
4 years ago

You are never calling the function, you can use GetPropertyChangedSignal() event and connect it to your function.

Ad
Log in to vote
0
Answered by
NSMascot 113
4 years ago
Edited 4 years ago
script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Parent.Parent.Sabers:WaitForChild("Black Saber").Bought.Value == true then
        script.Parent.Visible = true
        script.Parent.Parent.Parent.Sabers:WaitForChild("White Saber").TextButton.Visible = true
    elseif
        print("Ya dunt have da saber!") then
         end
    end
end)

this script is a local script that would go into a image/text button

0
by the way if this doesn't work then you might need to take away the entire of line 8 NSMascot 113 — 4y
0
it is not on click dude Toastitions 11 — 4y
0
sorry NSMascot 113 — 4y
0
sorry NSMascot 113 — 4y

Answer this question