Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Where would I find IntValues in a player?

Asked by
Mystdar 352 Moderation Voter
10 years ago

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.

0
Mana and MAXMana should be Mana.Value and MAXMana.Value. damagex443 325 — 10y
0
Sorry, still refuses to work. Mystdar 352 — 10y

1 answer

Log in to vote
3
Answered by 10 years ago

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
0
Sure, done. Mystdar 352 — 10y
0
Thanks, I've editted my post. damagex443 325 — 10y
0
Wait so why are we cloning the script we made yesterday into the PlayerGUI? Mystdar 352 — 10y
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 damagex443 325 — 10y
View all comments (3 more)
0
Sorry, i am totally confused, why are we cloning instead of just placing a new script there? Mystdar 352 — 10y
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. damagex443 325 — 10y
0
The GUI part doesn;t work for me I'll show you what I have done in the question. Mystdar 352 — 10y
Ad

Answer this question