#Why does this happen

1 messages · Page 1 of 1 (latest)

indigo stratus
#

So this part of my script for a killstreak type ability works, but once the player dies and their hitvalue leaderstat is destroyed, when it gets readded it doesnt increase their hitvalue when they punch someone but it increases the billboard gui's text value and on top of that for some reason after they die the value on the billboard gui is saved and even though they start with 0 on their billboard, when they hit someone it gets restored to the same amount before (for example if they had 10 hitvalue before they died and then they die and use the ability again and punch someone once the billboard gui's value becomes 11 but the hitvalue doesnt go up at all and stays 0)

polar rune
indigo stratus
#

might be

heady vine
indigo stratus
#

and this is the script that removes the intvalues

heady vine
indigo stratus
#

uh

#

yes

indigo stratus
#

only the billboard value increase

heady vine
#

and the value in leaderstats?

indigo stratus
#

doesnt increase

heady vine
#

alright I see

#

I quite don't get the structure of the script but here's at least two things I have checked: usage of conditional statement or the variable isn't updated

heady vine
indigo stratus
#

i viewed it from server perspective

indigo stratus
#

maybe

heady vine
#

I'm certain

#

because

#

the billboard changes in the server prspective

indigo stratus
#

yes

heady vine
#

so there's no need to worry about client sided, but the int value

indigo stratus
#

yeah well if the problem was client sided the intvalue would update

#

so its probably something to do with intvalue

indigo stratus
heady vine
indigo stratus
#

local humanoid = hit.Parent:FindFirstChild("Humanoid")
if plr:FindFirstChild("HitValue") then
local HitValue = plr:FindFirstChild("HitValue")
HitValue.Value += 1
plr.Character.HumanoidRootPart.BillboardGui.TextLabel.Text += 1
humanoid:TakeDamage(12 + (HitValue.Value * 0.25))
end

heady vine
#

nvm I see

#

try printing that

indigo stratus
#

lemme add a print prompt to check if its something to do with

#

yeah

#

ok soooo

indigo stratus
#

the billboard updates according to the first instance of hitvalue whether or not it still exists or not

heady vine
#

yeah it just goes back to the old value

indigo stratus
#

quite the dilemma

#

i just overwrited the billboardvalue by just making it add 1 instead of equaling the hitvalue

#

but hitvalue is still a problem since the moveset/ability directly is linked to it

heady vine
#

can you provide a video?

indigo stratus
#

uh

#

wait a sec

heady vine
#

demonstration at least, I honestly don't know what I'm looking foor

indigo stratus
indigo stratus
#

this is the script before i fixed the billboard problem

#

before i reset my hitvalue was indeed 2

#

and after i reset no matter how many times i punched the hitvalue was 0

#

and the billboard gui kept updating according the the old nonexistent hitvalue for some reason

#

and yes i checked to see if the old hitvalue was getting destroyed

sterile ledgeBOT
#

studio** You are now Level 6! **studio

heady vine
#

does the hitvalue get destroyed after the player dies?

indigo stratus
#

yes

heady vine
indigo stratus
#

what

heady vine
#

you're destroying the hitvalue in client sided

#

so what happens is that

indigo stratus
#

ohhhh

#

thats so true

heady vine
#

the server sided gets the "old hitvalue"

indigo stratus
#

yes the fact is that it still exists on the serverside

heady vine
#

but of course there will be a new hitvalue, but it doesn't get that new hitvalue, still the old one

indigo stratus
#

correct?

heady vine
#

yea

indigo stratus
#

alr i can fix it

#

thx a ton