Hi,
i tried this same script in PlayerGui and click detector but it doesn’t work for some reason:
script.Parent.MouseButton1Click:Connect(function(plr)
local a = Instance.new("WeldConstraint")
local b = game.ServerStorage.Union:Clone()
local char = game.Players.plr.Character
a.Parent = char.Head
b.Parent = char.Head
a.Part0 = a
a.Part1 = b
end)
Error: plr is not valid member of players
Any idea what is the cause of this error?