rukucii
(rukucii)
October 7, 2023, 3:52pm
#1
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!
astraIboy
(The Batman)
October 7, 2023, 3:53pm
#2
The clickdetector gives you a parameter for the person who clicked it compare it too the owner string value
SHlAWASE
(Shiawase)
October 7, 2023, 4:12pm
#3
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:
system
(system)
Closed
October 21, 2023, 4:12pm
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.