local userInputService = game:GetService("UserInputService")
local function GamepadConnected(gamepad)
print("Player has plugged controller: " .. tostring(gamepad))
end)
userInputService.GamepadConnected:Connect(GamepadDisconnected)
-- shouldn't this be GamepadConnected?
LocalScripts don’t run in the workspace unless they are a descendant of the player’s character. So someone can’t just slap this code into a localscript and put the localscript inside the door and expect it to work.
The API reference for the SelectionBox object is badly written and contains a misspelling, “SelectioBoxes” as well as a nonsensical sentence “An adornee what it shows up on”.
The reasoning it gives, is, uh, alright I guess? But you should probably state that if the object is referenced in a variable, it’s never removed from memory, not just This prevents your code from accessing anything to do with the object.
local Part = {
[workspace.Baseplate] = true
}
game.Workspace.Baseplate:Destroy()
wait(5)
for i in pairs(Part) do
print(i.Name)
end
> Baseplate
This is just how Lua’s GC will work, if it finds a reference to anything, whether it’s a userdata or just an every day variable. It will not remove it from memory if it can find a reference to it.
I feel this is a pretty significant fact about Lua to just completely gloss over