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

MaxMana is not a valid member of ScreenGui?

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

0

try :WaitForChild() and see if you get infinite yield

0

im getting infinite yield

0

Is maxmana in startergui?

0

its in a Gui that's in starter gui

0

put a print statement at the very top of your code to check if the script is running

2 answers

I Somehow fix it i don't know how though And i didn't use wait for child

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