I’ve got this script that fires an Event and makes a Value true/false and for some reason the Text isn’t changing even tho the Values are changing in the Output?
Local Script:
main.Blocks.MouseButton1Down:Connect(function()
if requirement.Value >= 50 then
buysound:Play()
equipbutton.Visible = true
blocksequip()
elseif requirement.Value < 50 then errorsound:Play()
if player:WaitForChild(“KillEffects”).Blocks then print(“Owned”)
if player:WaitForChild(“KillEffects”).Blocks.Value == true then
equipbutton.Text = “Unequip”
if player.KillEffects:WaitForChild(“Blocks”).Value == false then
equipbutton.Text = “Equip”
buysound:Play()
blocksequip()
end
end
end
end
end)
First of all, use ``` to make your code more readable (put them before the code and after). And I think the problem is you changing the text when you don’t have enough requested value (remove end and place it after errorsound:Play())
Oh ok i got where the problem is, I fixed your script. Try this out -
local player = game.Players.LocalPlayer
main.Blocks.MouseButton1Down:Connect(function()
local Blocks = player:WaitForChild("KillEffects").Blocks
if requirement.Value >= 50 then
buysound:Play()
equipbutton.Visible = true
blocksequip()
elseif requirement.Value < 50 then errorsound:Play()
if Blocks then print(“Owned”)
if Blocks.Value == true then
equipbutton.Text = “Unequip”
if Blocks.Value == false then
equipbutton.Text = “Equip”
buysound:Play()
blocksequip()
end
end
end
end
end)
Is your requirements value less than 50? Because the text changing if then statements are inside the else if statement. If you dont want it to be there than just put an end after the error sound is played and remove an end from the last few lines of the script