01-03-2012, 07:48 PM
Fixed code:
[lua]
function changeWorld(p, w)
p.Parent = game:getWorld(w).Players
p.Character.Parent = game:getWorld(w).World
end
link(script.Parent.MouseDown, function()
changeWorld(script.Parent.Parent.Parent.Parent, "level0")
end)
[/lua]
This is for a script inside a text button inside a frame inside the main player UI. To get rid of the button and whatnot, I'll let you code that out how you want.
[lua]
function changeWorld(p, w)
p.Parent = game:getWorld(w).Players
p.Character.Parent = game:getWorld(w).World
end
link(script.Parent.MouseDown, function()
changeWorld(script.Parent.Parent.Parent.Parent, "level0")
end)
[/lua]
This is for a script inside a text button inside a frame inside the main player UI. To get rid of the button and whatnot, I'll let you code that out how you want.