im trying to clone someone elses screengui to mine by using clickdetector.
Everything runs fines until clickdetector.mouseclick.I tried to print, nothing prints out.
It doesnt fire.
Im using a local script in starter gui.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
for i, v in pairs(game.Players:GetPlayers()) do
v.CharacterAdded:Connect(function(character)
if v.Name ~= player.Name then
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local part = Instance.new("Part")
part.Parent = workspace.profile
part.Name = v.UserId.."-profile"
part.Anchored = false
part.Size = humanoidRootPart.Size
part.Transparency = 1
part.CFrame = humanoidRootPart.CFrame
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part
local weld = Instance.new("Weld")
weld.Parent = part
weld.Part0 = part
weld.Part1 = humanoidRootPart
clickDetector.MouseClick:Connect(function(playerWhoClicked)
print(playerWhoClicked.Name)
local playerTargetProfile = v.PlayerGui.profileGui:Clone()
playerTargetProfile.Enabled = true
playerTargetProfile.nameTagFrame:Destroy()
playerTargetProfile.Parent = player.PlayerGui
end)
end
end)
end```