I know the title may be a little confusing, so let me explain further.
I'm a beginner scripter, and I'm trying to practice making scripts run on the client, but in a way that it only plays for the person who activated the script.
So, what I'm trying to do now is make it so that if the player touches a red part, it destroys the blue part next to it, but ONLY for the player that touched the red part. (It appears for no one else.)
I thought all it would take to achieve this is for the LocalScript to be in StarterGui, but that's not the case. Help would be appreciated!
Here's my script right now.
--LocalScript inside StarterGui
workspace.redbrick.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then --Checks if the person who hit was a player
workspace.bluepart:Destroy() --Destroys the blue brick when the red brick is touched by the player
end
end)
--(I want the blue brick to destroy only for the player that touched it)

1 comment
Nevermind! I figured it out by using remote events. I made the server check for the touch, then ran the destroy code on the client.