I'm making a stats upgrading system, most of them require just changing humanoid properties which i know how to do. however one stat requires to change the character's appearance, but i can't change it through local script. all of the intvalues are stored inside the PlayerGui as they don't reset whenever the player dies. what should i do?
Script that updates player's stats whenever they spawn.
local function PlayerAdded(players)
players.CharacterAdded:Connect(function(char)
wait(0.5)
char.Humanoid.WalkSpeed = players.PlayerGui.Stats.Buffs.Speed.Value
print("speed set")
char.Humanoid.JumpPower = 5
char.Humanoid.MaxHealth = 10
char.RightUpperArm.Size = Vector3.new(1, 0.1, 1)
char.LeftUpperArm.Size = Vector3.new(1, 0.1, 1)
char.RightLowerArm.Transparency = 1
char.LeftLowerArm.Transparency = 1
char.RightHand.Transparency = 1
char.LeftHand.Transparency = 1
end)
end
game.Players.PlayerAdded:Connect(PlayerAdded)
Localscript inside a textbutton that changes players stats whenever an intvalue updates.
local points = script.Parent.Parent.Parent.Parent.Buffs.Points
local buffs = script.Parent.Parent.Parent.Parent.Buffs
script.Parent.MouseButton1Click:Connect(function()
if points.Value >= 1 then
points.Value = points.Value - 1
buffs.Speed.Value = buffs.Speed.Value + 1
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = buffs.Speed.Value
end
end)
