script.Parent.Events.DamageEvent.OnServerEvent:Connect(function(plr) local damage = script.Parent.Damage --//Damage = 0 local starterdamage = script.Parent.StarterDamage --//Damage = 4 local Level = game.ReplicatedStorage[plr.Name.."Data"].Level local Damagecandeal = game.ReplicatedStorage[plr.Name.."Data"].DamageCanDealByFruit --//Damagecandeal = 0 local Stats = game.ReplicatedStorage[plr.Name.."Data"].Stats --//Stats = 3 while true do wait(.1) Damagecandeal.Value = starterdamage.Value * Stats.Value damage.Value = Damagecandeal.Value print(damage.Value) --//0 / the print end end)
it prints(0) ?
we went over his code in DM and turns out it was an issue with how he was saving data. he forgot to save one of the values causing line 10 to multiply by zero.
if you have a similar problem, trace your steps. see if you changed the value anywhere. if you use datastore like op did, see if you're saving the data properly / where you're getting the value from in the first place.
Oh my god. Please learn some basic naming convention for Lua before scripting. This code is unbearable. Spacing is random, variable names' case is random, comments are basically nonexistent (apart from those that you put to indicate what the values should be). Please read this. It'll help.
For your question. Are you sure your values are set? Are you sure starterdamage.Value
is 4 and Stats
is 3?