The error is at the if statement Can someone please tell me how to fix this? its not finding the int value even though it exist in the gui!
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.E then
if script.Parent.Equip.Value == true and SlashCool == false and ManaGui.MaxMana.Value > 0 then
if ManaGui.MaxMana.Value > 20 then
SlashCool = true
ReFol.RSKILL:FireServer()
ManaGui.MaxMana.Value = ManaGui.MaxMana.Value - 20
wait(5)
SlashCool = false
else
ManaGui.ManaEn.Visible = true
ManaGui.ManaFrame.Frame.TextLabel.Text = "Not Enough Mana"
wait(.3)
ManaGui.ManaEn.Visible = false
ManaGui.ManaFrame.Frame.TextLabel.Text = "Mana"
end
end
end
end)
EDIT:when you die and respawn it will says that it cant find maxMana

5 comments
try :WaitForChild() and see if you get infinite yield
im getting infinite yield
Is maxmana in startergui?
its in a Gui that's in starter gui
put a print statement at the very top of your code to check if the script is running