Why won’t this script work im a bit new to scripting
local Click = script.Parent.ClickDetector
local Players = game:GetService("Players")
local function Sayname()
print(Players.LocalPlayer)
end
Click.MouseClick:Connect(Sayname)
Why won’t this script work im a bit new to scripting
local Click = script.Parent.ClickDetector
local Players = game:GetService("Players")
local function Sayname()
print(Players.LocalPlayer)
end
Click.MouseClick:Connect(Sayname)
clickDetector.MouseClick returns the player that clicked the button so i assume you are using a script and not a local script instead do this:
local Click = script.Parent.ClickDetector
local function Sayname(plr)
print(plr.Name)
end
Click.MouseClick:Connect(Sayname)