print(game:FindService("Workspace"))
--> Workspace
Instance.new("Model", game)
print(game:FindService("Model"))
--> nil
So the method returns nil if there is no service by that name.
<# | |
Google Photos stores files by the last modified date | |
This is unfortunate because the resulting timeline is inaccurate | |
Wrote this script to correct this by recursing through a directory and setting each file's last modified date to its creation date | |
Released under MIT License | |
Copyright (c) 2020 Matthew Dean | |
#> | |
$files = Get-ChildItem -recurse -force -Path C:\Users\Matthew\Downloads\ExampleDir | Where-Object {! $_.PSIsContainer} |
-- compatible with R6 and R15 | |
local function placeCharacterOnSpawnLocation(character, spawnLocation) | |
local topCenterOfSpawn = spawnLocation.CFrame + Vector3.new(0, spawnLocation.Size.Y / 2, 0) | |
local hipHeight = character.Humanoid.RigType == Enum.HumanoidRigType.R15 and character.Humanoid.HipHeight or 2 | |
local distanceFromBottomOfCharacterToMidTorso = hipHeight + character.Torso.Size.Y / 2 | |
character.Torso.CFrame = topCenterOfSpawn + Vector3.new(0, distanceFromBottomOfCharacterToMidTorso, 0) | |
end |
game.Players.PlayerAdded:connect(function(player) | |
player.CharacterAdded:connect(function(character) | |
character.Head.ChildAdded:connect(function(sound) | |
if sound:IsA("Sound") then | |
if sound.SoundId == "rbxasset://sounds/uuhhh.mp3" then | |
sound.SoundId = "http://www.roblox.com/asset/?id=143531018" | |
elseif sound.SoundId == "rbxasset://sounds/splat.wav" then | |
sound.Volume = 0 | |
end | |
end |
function HasMember(instance, member) | |
assert(pcall(game.IsA, instance, '')) | |
assert(type(member) == "string")) | |
local success, result = pcall(function() return instance[member] end) | |
if not success then | |
return not result:match('not a valid member') | |
end | |
print(game:FindService("Workspace"))
--> Workspace
Instance.new("Model", game)
print(game:FindService("Model"))
--> nil
So the method returns nil if there is no service by that name.
-- emulates Instance:GetFullName() | |
function getFullName(instance) | |
local names = {} | |
repeat | |
table.insert(names, 1, instance.Name) | |
instance = instance.Parent | |
until not instance or instance:IsA("ServiceProvider") | |
return table.concat(names, ".") | |
end |
var memoryStream = (MemoryStream) System.Windows.Clipboard.GetData("application/x-roblox-studio");
var streamReader = new StreamReader(memoryStream);
string xml = streamReader.ReadToEnd();
MessageBox.Show(xml);
I spent many hours today seeing if browsers could copy arbitrary content to the clipboard but with the MIME type application/x-roblox-studio
(normally it's just text/plain
) but then I found this page:
local obj = {} | |
local function test() return obj end | |
setmetatable(obj, {__index=test, __call=test}) | |
_ENV = obj | |
game:Destroy() | |
print(Game) | |
(function() end)()() | |
while testlol do -- inifnite loop here because testlol is always truthy :/ | |
end |
local function require(url) | |
local source = Game:GetService('HttpService'):GetAsync(url) | |
return loadstring(source)() | |
end | |
local bindableFunction = Instance.new('BindableFunction') | |
bindableFunction.Name = 'Require' | |
bindableFunction.OnInvoke = require | |
bindableFunction.Parent = Game:GetService('ServerStorage') |
local function onError(errorMessage) | |
print(errorMessage) | |
end | |
local Players = Game:GetService("Players") | |
local reportedErrors = {} | |
Players.DescendantAdded:connect(function(instance) | |
if instance.Name == "AdminStatsFrame" then | |
instance.Visible = false |