Touched function doesn't work properly a second time

if i switch to serverside the script to set the hp to 1 works every time. If I switch to the client it doesn’t see it

so when you touch it on the server its 1 and on the client its bigger?

ok so on if I touch it once on the client it shows my hp going to 1, after i heal and touch it again I don’t see my hp going to 1 unless i switch to server side

Do this: after you touch it heal, and then after it heals look at the server side and if the number is still one then tell me

It indeed doesn’t heal on the server side.It’s because the script is in starter character scripts not player scripts?

its because it is a LocalScript

the healing script needs to be a ServerScript

2 Likes

so do I use a remote event or just make the script a server script

if you want it to trigger when a certain key is pressed then yes, use a remote event

Thank you so much for taking time to explain things and help!

No problem my dude, If you want any more help just message me!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.