can someone help me? Power.Value = Power.Value not working D:
This script is in PlayerCharacterScripts
local Player = game:GetService("Players").LocalPlayer local Character = Player.Character local Humanoid = Character:WaitForChild("Humanoid") Humanoid.Jumping:Connect(function() local Power = Player:WaitForChild("leaderstats"):WaitForChild("Power") Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) Power.Value = Power.Value +0.25 wait(3) Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true) end)
You could do something like this.
--// Client local Update = game:GetService("ReplicatedStorage"):WaitForChild("Update") Update:FireServer(.25)
--// Server local Update = Instance.new("RemoteEvent") Update.Name = "Update" Update.Parent = game:GetService("ReplicatedStorage") Update.OnServerEvent:Connect(function(Plr, Amount) assert(Amount, "Amount cannot be nil.") assert(type(Amount) == "number", "Amount must be of type number.") local LS = Plr:FindFirstChild("leaderstats") local Power = (LS and LS:FindFirstChild("Power")) or nil if LS and Power then assert(Power:IsA("ValueBase"), "Power must be of class ValueBase.") assert(type(Power.Value) == "number", "Value must be of type number.") Power.Value = Power.Value + Amount end end)
I don't recommend this though, exploiters can use this to get an infinite amount of points.
Make sure the script is a script, not a localscript. You cannot change values on the client side.