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

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

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

5 comments

0

If theres no errors. Then there aren't any syntax problems. What is the thing your trying to do whit your script?

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

0

do not work properly

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.

0

edited

2 answers

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

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

4 comments

0

by the way if this doesn't work then you might need to take away the entire of line 8

0

it is not on click dude

0

sorry

0

sorry

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