Hello, fellow Lua users. I am quite new to Roblox scripting and I would want to ask you how can you find a player that clicked an object. For example, I tried this method: ...MouseButton1Down:connect(function(plr) plr = game.Players:FindFirstChild(plr). This did not really work out. Here is the full script if you want to look at it
script.Parent.ClickDetector.MouseClick:connect(function(c)
local plr = game.Players:FindFirstChild(c)
if plr.PlayerGui.CarName.Value == "power" then
script.Parent.Material = "SmoothPlastic"
local clone = game.ServerStorage["2011 F-250 Super Duty 6.7L Power Stroke"]:Clone()
clone.Parent = game.Workspace
end
end)
I hope this question was understandable enough with my lack of English.

2 comments
So can I just say 'if c.PlayerGui.CarName.Value == "power"?
Yes.