function onTouched(part) if part.Name == "Left Leg" or part.Name == "Right Leg" then local player = game.Workspace:GetPlayerFromCharacter(part.Parent) player.leadstats.Money.Value = script.Parent.Money.Value+player.leadstats.Money.Value script.Parent.Parent.Main:remove() end end script.Parent.Touched:connect(onTouched)
it says GetPlayerFromCharecter Is not a vaild member of Workspace....
local main = script.Parent.Parent:WaitForChild("Main") function onTouched(part) if part.Name == "Left Leg" or part.Name == "Right Leg" then local player = game.Players:GetPlayerFromCharacter(part.Parent) local leaderstats = player and player:findFirstChild("leaderstats") local money = leaderstats and leaderstats:findFirstChild("Money") if money then money.Value = money.Value +5 if main then main:Destroy() end end end end script.Parent.Touched:Connect(onTouched)