Im trying to make it so when you punch you deal damage, i have the local script i just need help with the server script to send the damage to the server but i have no idea on what im doing.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Punch = ReplicatedStorage:WaitForChild("Punch")
local player = game.Players.LocalPlayer
local str = player.leaderstats.strength
Punch.OnServerEvent:Connect(function(player)
player.Parent.Humanoid:TakeDamage(str)
end)
This is what i have so far, im getting the error "attempt to index nil with 'leaderstats' i want to make it so the more strength you have that's the amount of damage you do so if u earned 100 strength you do 100 damage, etc.

2 comments
i can't really help with the index nil with leaderstats thing but i do think i see something else, on local str = player.leaderstats.strength you should add .Value to the end of it so it can be assigned to the value of strength and not just the variable strength
I got the same error, is there another way i can get the players stats?