inside a p:art called "Spirit" there are two scripts:
one Supposedly should give EXP when touched by the "WaterEssence":
P.D.: "EXP" is in a folder named "leaderstats" inside the character
local ATM = script.Parent
ATM.Touched:connect(function(entity)
print(entity:GetFullName())
if entity.Parent.Name == "WaterEssence" then
local Man = entity.Parent.Parent.Parent
local RealMan = game.Players:GetPlayerFromCharacter(Man)
local Bro = RealMan.FindFirstChild("leaderstats")
local EXP = RealMan.Bro:FindFirstChild("EXP")
EXP.Value = EXP.Value + 100
print(EXP.Value)
wait(1)
end
end)
the other one just makes it invisible.
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "WaterEssence" then
script.Parent.Transparency = 0.5
wait(20)
script.Parent.Transparency = 0
end
end)
the invisible script works fine, but the other one shows this error:
error: Workspace.Spirit.Script:12: attempt to index local 'RealMan' (a nil value)
if you dont have any ideas, please give me an alternative way to do it.
Thanks to everyone, SuVee, Aspiring Dev

4 comments
If a player's limb is hitting it, then the Man should equal entity.Parent
no, a handle from a tool is hitting it.
I see the problem, and it is trying to get the player. I'll try to use another way to get the player and show you it.
https://twitter.com/iamdevloper