Update gameserver.php
This commit is contained in:
parent
691ce8f01a
commit
830efeafd2
|
|
@ -166,6 +166,42 @@ end)
|
||||||
|
|
||||||
-- Now start the connection
|
-- Now start the connection
|
||||||
game:Load("rbxasset://<?php echo $rbxl; ?>")
|
game:Load("rbxasset://<?php echo $rbxl; ?>")
|
||||||
|
-- fix asset ids
|
||||||
|
local assetPropertyNames = {"Texture", "TextureId", "SoundId", "MeshId", "SkyboxUp", "SkyboxLf", "SkyboxBk", "SkyboxRt", "SkyboxFt", "SkyboxDn", "PantsTemplate", "ShirtTemplate", "Graphic", "Frame", "ImageLabel", "GuiMain", "Image", "LinkedSource", "AnimationId"}
|
||||||
|
local variations = {"http://www%.roblox%.com/asset/%?id=", "http://www%.roblox%.com/asset%?id=", "http://%.roblox%.com/asset/%?id=", "http://%.roblox%.com/asset%?id="}
|
||||||
|
|
||||||
|
function GetDescendants(o)
|
||||||
|
local allObjects = {}
|
||||||
|
function FindChildren(Object)
|
||||||
|
for _,v in pairs(Object:GetChildren()) do
|
||||||
|
table.insert(allObjects,v)
|
||||||
|
FindChildren(v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
FindChildren(o)
|
||||||
|
return allObjects
|
||||||
|
end
|
||||||
|
|
||||||
|
local replacedProperties = 0--Amount of properties changed
|
||||||
|
|
||||||
|
for i, v in pairs(GetDescendants(game)) do
|
||||||
|
for _, property in pairs(assetPropertyNames) do
|
||||||
|
pcall(function()
|
||||||
|
if v[property] and not v:FindFirstChild(property) then --Check for property, make sure we're not getting a child instead of a property
|
||||||
|
assetText = string.lower(v[property])
|
||||||
|
for _, variation in pairs(variations) do
|
||||||
|
v[property], matches = string.gsub(assetText, variation, "http://www%.morblox%.us/asset/%?id=")
|
||||||
|
if matches > 0 then
|
||||||
|
replacedProperties = replacedProperties + 1
|
||||||
|
print("Replaced " .. property .. " asset link for " .. v.Name)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- other stuff
|
||||||
ns:Start(<?php echo $port; ?>, sleeptime)
|
ns:Start(<?php echo $port; ?>, sleeptime)
|
||||||
pcall(function() game.LocalSaveEnabled = true end)
|
pcall(function() game.LocalSaveEnabled = true end)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue