And leaderstates. Would it be?
1 | local a = game.players.character.IntValue.Value |
Preferably without knowing the player name, OR a script with the player names. Yesterday, if you remember my question on Mana and MAXMana in the player. I want to know how to find out their value, so ultimately, I can have a GUI with: (Inside a TextLabel)
1 | while true do |
2 | script.Parent.Text = "Mana: " .. --How to find current mana |
3 | .. "/" .. |
4 | --How to find Mana) |
5 | wait( 0.1 ) |
6 | end |
I will also want a way to take away Mana
1 | local a = -- How to find Mana |
2 | -- Then when you cast the spell (Uses 10 Mana) |
3 | local a = local a- 10 |
The GUI doesn't work I have a text label parented to a Frame, screen GUI, Starter GUI, in the Text Label there is a script:
1 | local MAXMana = script.Parent.Parent.MAXMana -- As you said |
2 | local Mana = script.Parent.Parent.Mana -- As you said |
3 | while true do |
4 | script.Parent.Text = "Mana: " .. Mana .. "/" .. MAXMana.. |
5 | wait( 0 ) |
6 | end |
I have probably screwed something up, apologies, if I have.
The script you made yesterday that sets the IntValues. In that script, you can make a clone from the script you're trying to make now and put it in the PlayerGui.
1 | local Script = game.ServerStorage.Script:Clone() |
2 | Script.Parent = player.PlayerGui -- Change names according to your script |
Now from within the script you just cloned to PlayerGui, you can do
1 | local player = script.Parent.Parent -- This contains the Backpack, PlayerGui, leaderstats etc. |
2 | local char = player.Character -- This contains the parts and humanoid. |
Then in this script you can create a function like
1 | function Cast() |
2 | player.Stats.Mana = player.Stats.Mana - 10 |
3 | end |