How to fix server side damage script?
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.
1 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
2 | local Punch = ReplicatedStorage:WaitForChild( "Punch" ) |
3 | local player = game.Players.LocalPlayer |
4 | local str = player.leaderstats.strength |
6 | Punch.OnServerEvent:Connect( function (player) |
7 | player.Parent.Humanoid:TakeDamage(str) |
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.