Goal To make the script know which GUIButton the player clicked on. Problem I have no Idea how to do it, I have a "Color" parameter which that can turn into the Button that was pressed but still the script don't know which button was pressed unless I print it but that just won't do anything except for printing the name of the GUIButton that was pressed.
--LocalScript
local function PressedColor(ColorB)
ColorB.MouseButton1Click:Connect(function()
FlareRE:FireServer(ColorB.Parent)
end)
end
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.F then
script.Parent.Enabled = true
PressedColor(PurpleB)
PressedColor(BlackB)
PressedColor(RedB)
PressedColor(BlueB)
PressedColor(YellowB)
PressedColor(GreenB)
end
end)
--Script
Players.PlayerAdded:Connect(function(P)
P.CharacterAdded:Connect(function(C)
FlareRE.OnServerEvent:Connect(function(P, Color)
print(Color)
end)
end)
end)
