Owner only button

Hello,

So basically what im looking for is the following:

I have a clickdetector, but what want is the ONLY person who can click that button is the owner of the vehicle.

The owner of the vehicles name is in a StringValue, that works when you spawn the vehicle, the value is the owners name.

So how can the owner “Name in the Value” be the only one to click a button.

Thanks!

The clickdetector gives you a parameter for the person who clicked it compare it too the owner string value

Implementation of @astraIboy’s reply:

local car = script.Parent

car.ClickDetector.MouseClick:Connect(function(player)
	if player.Name == car.Owner.Value then
		print("This is your car")
	end
end)

Structure:
image

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