Local Script

player = game.Players.LocalPlayer
player.Character:WaitForChild("Humanoid").Died:Connect(function()
	game.ReplicatedStorage.RemoteEvents.characterAdded:FireServer()
	wait(0.1)
end)

Script

game.ReplicatedStorage.RemoteEvents.characterAdded.OnServerEvent:Connect(function(player)
	local playerName = player.Name
	workspace:WaitForChild(playerName)
	repeat wait() until player.Character
		local Str = player.Stats.Strength.Value
		local Agi = player.Stats.Agility.Value
		local Int = player.Stats.Intelligence.Value
		local Def = player.Stats.Defense.Value
		local Vit = player.Stats.Vitality.Value
		local Dex = player.Stats.Dexterity.Value
		print(Str)
	workspace:FindFirstChild(playerName).Humanoid.MaxHealth = workspace:FindFirstChild(playerName).Humanoid.MaxHealth+(2*Str)+(4*Vit)
	workspace:FindFirstChild(playerName).Humanoid.Health = workspace:FindFirstChild(playerName).Humanoid.MaxHealth
end)

it doesn't print anything. I'm starting to loathe this client-server relationship thing T_T

1 comment

0

no errors btw