This is my punch script (Animation), I'm trying to connect it to my exp value so that players get +1 exp when connecting with another humanoid, but I'm not sure where to start. The exp is an intvalue located in replicatedstorage.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local dmg = true
Mouse.KeyDown:connect(function(key)
if key == "e" then -- change e to button to activate punch
local an = script.Parent.Humanoid:LoadAnimation(script.Animation)
an:Play()
script.Parent.RightHand.Touched:connect(function(hit)
if hit.Parent.Humanoid and dmg == true then -- i assume after the then statement a change in the exp would be put here
hit.Parent.Humanoid:TakeDamage(game.ReplicatedStorage.StrengthStatValue.Value * 16) -- change 10 to amount of damage
dmg = false
wait(1)
dmg = true
end
end)
end
end)
