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

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

Asked by
soutpansa 120
7 years ago
Edited 7 years ago

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
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. Azarth 3141 — 7y
0
I will look into using an event. Thank you soutpansa 120 — 7y

1 answer

Log in to vote
-1
Answered by 7 years ago

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.

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 soutpansa 120 — 7y
0
Especially with our discord .-. soutpansa 120 — 7y
0
but the damage is still a value connor12260311 383 — 7y
0
a hacker could make it script.Parent.Value * 100000000000 is they wanted connor12260311 383 — 7y
0
And they can get banned for it too :) soutpansa 120 — 7y
Ad

Answer this question