Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Show messsage when touch Not working :( ?

This should show the Message when you touch "Part"

function onHit(hit) -- Made By ME
	local human = hit.Parent:findFirstChild("Humanoid")
	if (human ~= nil) then


human.Health = 100 
local message = Instance.new("Message")
message.Text = "TST"
message.Parent = game.Players:playerFromCharacter(hit.Parent)
wait(3) 
message:Remove ()
	end
end

script.Parent.Touched:connect(onHit)

But its not working :/

1 answer

human.Health

This is the line that most likely causes it, if you want to set the health to 100 then you gotta do the following.

human.Parent.Humanoid.Health = 100

or

human.Parent.Humanoid.Health = human.Parent.Humanoid.Health + 100

Also, it's not playerFromCharacter

It's GetPlayerFromCharacter.

This discussion is preserved as it was. New answers, comments, and votes are closed.