Hello everyone! I would like to make a brick so when you touch it, it will run a script on your client only. How would I do this?

I've created this simple script that will execute something when it's touched, but on the server. How do I make it run ONLY on your client

function onTouched() 
--stuff here
end 
script.Parent.Touched:connect(onTouched) 

Thank you.

8 comments

0

Do you know how to use localscipts?

0

ive tried that.... it doesn't work

0

Do you have Filtering Enabled?

0

yes..

0

oh i know

0

when the player touches WHICH brick?

0

https://prnt.sc/tokgpn - I have two bricks in the server. The red one is supposed to destroy the white one ONLY ON YOUR CLIENT. it works with regular scripts, but executes on the server.

0

Make the script a local script and copy and paste the code. Then change script.Parent.Touched to something that points to the block like workspace.part.Touched. That way it all runs in a local script, and therefore the client