Ad
Log in to vote
0

Value doesnt wanna update?

Asked by 14 days 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:

local TargetPart = script.Parent.Parent.TargetPart
local req = 1e+12
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        local stats = player.Stats
        local TP = player.ExtraData.TotalPower
        local HumRP = player.Character.HumanoidRootPart
        print(TP.Value)
        if TP.Value >= 1e+12 then --Game thinks TP is 0 while it is more
            HumRP.CFrame = TargetPart.CFrame
        end
    end
end)

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 — 14d
0
It is in a script tho. Ludzik78 81 — 14d
0
Oh wait. Ludzik78 81 — 14d

Answer this question