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

Where would I find IntValues in a player?

And leaderstates. Would it be?

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)

while true do
script.Parent.Text = "Mana: " ..  --How to find current mana 
..   "/" .. 
--How to find Mana)
wait(0.1)
end

I will also want a way to take away Mana

local a= -- How to find Mana
-- Then when you cast the spell (Uses 10 Mana)
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:

local MAXMana = script.Parent.Parent.MAXMana -- As you said
local Mana = script.Parent.Parent.Mana -- As you said
while true do
script.Parent.Text = "Mana: " .. Mana .. "/" .. MAXMana..
wait(0)
end

I have probably screwed something up, apologies, if I have.

2 comments

0

Mana and MAXMana should be Mana.Value and MAXMana.Value.

0

Sorry, still refuses to work.

1 answer

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.

local Script = game.ServerStorage.Script:Clone()
Script.Parent = player.PlayerGui  -- Change names according to your script

Now from within the script you just cloned to PlayerGui, you can do

local player = script.Parent.Parent -- This contains the Backpack, PlayerGui, leaderstats etc.
local char = player.Character -- This contains the parts and humanoid.

Then in this script you can create a function like

function Cast()
	player.Stats.Mana = player.Stats.Mana - 10
end

7 comments

0

Sure, done.

0

Thanks, I've editted my post.

0

Wait so why are we cloning the script we made yesterday into the PlayerGUI?

0

We don't, we make a new script and clone that one in the PlayerGui. Put the new script in the ServerStorage (The script you made in your post above). Then from the script we made yesterday, clone it to the PlayerGui

0

Sorry, i am totally confused, why are we cloning instead of just placing a new script there?

0

Well, now that I've come to think of it. You don't have to clone it actually. You can just put the script in PlayerGui. Then you can call player values with the 2nd script part I've shown above. I'm used to doing most of these things through scripting, but this isn't necessary. You can ignore the first part.

0

The GUI part doesn;t work for me I'll show you what I have done in the question.

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