Hello.
I want to ask if it is possible to put parameters in event functions like MouseEnter.
For instance, take this MouseEnter script:
function Gr8() end game.Players.LocalPlayer.PlayerGui.JusticeEndo.MouseEnter:connect(GR8);
How could you put parameters into something like that!? Is that possible using this method? Are there other methods? Please help, thanks.
Just run the function in an anonymous function passed to the event (Nested Functions).
local function bork(one,two) print(one.." slipped on a "..two.."!") end game.Players.PlayerAdded:connect(function(player) --anonymous function fired when player is added, with player passed as an argument bork(player.Name,"banana") ------------------> "Arithmeticity slipped on a banana!" end)
Like duckwit said, you can't directly pass in 'extra' arguments, but you can do this:
function foo(bar) print(bar) end game.Players.LocalPlayer.PlayerGui.JusticeEndo.MouseEnter:connect(function() foo("FOR DAMACIA!") end)