It looks like you're a beginner scripter, so try learning the basics and then go on and study events. But anyway, to answer the question, you have to say LPlayer.leaderstats.laps.Value = LPlayer.leaderstats.laps.Value + 1. This basically means value is equal to value plus 1. Also, you don't have to say game.LPlayer since it's a variable. Below is what the full script would look like.
script.Parent.Touched:Connect(function(hit)
local LPlayer = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
LPlayer.leaderstats.laps.Value = LPlayer.leaderstats.laps.Value + 1
end)
You should remove the if in if script.Parent.Touched:Connect(function() since it would error. And finnaly, you shouldn't use game.Players.LocalPlayer in a ServerScript, as it would return nil. Please try doing more research on Roblox Lua before asking.
2 comments
I don't know if this will work but try "game.LPlayer.leaderstats.laps.Value + 1" Notify me if that doesn't work..
That will not. Seriously Lua, what happened to the += operator....