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

[SOLVED, Answer on last line]Value will not change until the Player resets?

I've got a skill that does a set amount of damage to a player when used. The amount it does is defined in an Int Value named Damage. The player also has a stat called SkillDamage, that increases with each level. The base damage of the skill (the value of Damage) is added to the SkillDamage level of the player via a Local Script. But the change does not occur until the player resets. Is there anything that I can do to fix this? Maybe a type of loop with set conditions or an event?

Script that adds damage:

local Player = game.Players.LocalPlayer

 
script.Parent.Value = script.Parent.Value + Player.Levelss.SkillDamage.Value

Instead of using an event, I simply made it so that each time the button for the attack is pressed it copies the Damage Value to the correct script to do the damage, but each time the copy's value is added to the skill damage value, so that it will update on it's own.

2 comments

2

You need an event to trigger a function that adds the stat. For instance, have the "Changed" event set to a players stat, so when the Value changes it triggers a function.

0

I will look into using an event. Thank you

1 answer

Your problem is that this is in a local script, and if FE is on then it won't work. Either way, changing stats from the client side is not recommended as it is easily hacked.

5 comments

0

The script works fine because filtering enabled is not on. Stats are changed with a normal script, the local script just sets the damage. Besides, the age limit on the game will prevent anyone who doesn't have an account that is at least a year old. Exploiters will be easy to catch

0

Especially with our discord .-.

0

but the damage is still a value

0

a hacker could make it script.Parent.Value * 100000000000 is they wanted

0

And they can get banned for it too :)

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