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

Value doesnt wanna update?

Asked by
Ludzik78 136
4 years ago

Im currently making a power based game and i have trouble with one thing, that is that the TotalPower doesnt wanna update. My code:

01local TargetPart = script.Parent.Parent.TargetPart
02local req = 1e+12
03script.Parent.Touched:Connect(function(hit)
04    if hit.Parent:FindFirstChild("Humanoid") then
05        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
06        local stats = player.Stats
07        local TP = player.ExtraData.TotalPower
08        local HumRP = player.Character.HumanoidRootPart
09        print(TP.Value)
10        if TP.Value >= 1e+12 then --Game thinks TP is 0 while it is more
11            HumRP.CFrame = TargetPart.CFrame
12        end
13    end
14end)

Things i've tried: Print debugging (Keeps saying TP is 0) Manually going to the path

1
Make sure to update the TP in a script and not a local Script, so it actually updates. esepek 103 — 4y
0
It is in a script tho. Ludzik78 136 — 4y
0
Oh wait. Ludzik78 136 — 4y

Answer this question