for i,v in pairs(game.Players:GetPlayers()) do
local button = script.Playerbutton:Clone()
button.Text = v.Name
button.Name = v.Name
button.Parent = script.Parent.DampeningMF.ScrollingFrame
button.MouseButton1Click:Connect(function()
if workspace:FindFirstChild(button.Name) then
button.MouseButton1Click:Connect(function()
print(button.Name)
local targetplr = Players[button.Name]
print(targetplr.Name)
ReplicatedStorage.Events:WaitForChild("Pressed"):FireServer(plr, targetplr)
end)
end
end)
end
#Why doesn't this for i,v loop update?
2 messages · Page 1 of 1 (latest)