generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Handheld Scaling tool help!

Previous Thread :: Next Thread 
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
07 Sep 2013 03:39 PM
Soooo, first i need to confirm if its possible.

And its a tool. Heres how i want it to work.

I equip the tool and click a model, it should then shrink down to 1/50 the size. Also it shouldn't create a copy of that model.

I think editting a scaling script would be eh... not good results....

Soo how to make a tool that u can hold that can scale stuff to 1/50 its size..



And no flaming or stupid posts "DO IT YOURSELF"

Im just a newbie scripter....

SO NO FLAMING!
Report Abuse
pj473 is not online. pj473
Joined: 02 Aug 2006
Total Posts: 530
07 Sep 2013 03:46 PM
#Flame

Anyways

Have fun making that >.>

I would try to help but I'm sure someone had a better way
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 07:38 AM
bump. Cmon guys...
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
08 Sep 2013 08:43 AM
It is possible.

Use the Mouse.Hit property to determine what you have. Then you can use a Parent to search for a Model. if the Model exist, you get all the parts with a For index, value in pairs(Model) loop, and then do the necassary scaling based on the size * 0.98 (1 - 1/50 = 1 - 0.02 = 0.98)

Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 09:17 AM
Interesting, but then again im a newbie soo.

Please put that information into a script, thank you.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 12:14 PM
Bump, please help
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 01:53 PM
BUMP again.

help!
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 02:46 PM
BUMP

I though the roblox community is helpful..

Please convert the statement that velibor stated into a working script please!

just please...

I might host a reward of 300 tix
Report Abuse
Hannah8D is not online. Hannah8D
Joined: 22 Sep 2012
Total Posts: 24
08 Sep 2013 02:49 PM
Dang 300 tix thats alot of money. not really
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 03:00 PM
If u have something useful to add here then post....

Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
08 Sep 2013 04:21 PM
BUMP BUMP

Please guys help me like u help others
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
09 Sep 2013 02:50 PM
BUMP.

please help
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
09 Sep 2013 03:43 PM
scale = 10 / 70

local representation = Instance.new("Model")
representation.Parent = script.Parent
representation.archivable = false
representation.Name = "SmallMap"

function makeRepresentation(obj, cf, name)
if not obj.archivable then
return
end
if ((obj.className == "Part") or (obj.className == "Seat") or (obj.className == "SpawnLocation")) then
local rep = Instance.new("Part")
rep.formFactor = obj.formFactor
rep.Size = obj.Size * scale
rep.Transparency = obj.Transparency
rep.Reflectance = obj.Reflectance
rep.BrickColor = obj.brickColor
rep.Anchored = true
rep.Locked = true
rep.TopSurface = Enum.SurfaceType.Smooth
rep.BottomSurface = Enum.SurfaceType.Smooth
rep.Shape = obj.Shape
rep.Name = name
mesh = Instance.new("SpecialMesh")
mesh.Scale = obj.Size * scale / rep.Size
local list = obj:GetChildren()
local objMesh = nil
for x = 1, #list do
if (list[x].className == "Decal") then
local copy = list[x]:Clone()
copy.Parent = rep
elseif (list[x].className == "SpecialMesh") or (list[x].className == "CylinderMesh") or (list[x].className == "BlockMesh") then
objMesh = list[x]
end
end
if objMesh ~= nil then
mesh:Remove()
mesh = objMesh:Clone()
if (objMesh.className == "SpecialMesh") and (objMesh.MeshType == Enum.MeshType.FileMesh) then
mesh.Scale = objMesh.Scale * scale
else
mesh.Scale = objMesh.Scale * obj.Size * scale / rep.Size
end
elseif obj.Shape == Enum.PartType.Ball then
mesh.MeshType = Enum.MeshType.Sphere
elseif obj.Shape == Enum.PartType.Block then
mesh:Remove()
mesh = Instance.new("BlockMesh")
mesh.Scale = obj.Size * scale / rep.Size
--mesh.MeshType = Enum.MeshType.Brick
else
mesh.MeshType = Enum.MeshType.Cylinder
rep.Shape = Enum.PartType.Ball
end
mesh.Parent = rep
rep.CFrame = cf:toWorldSpace(obj.CFrame + obj.Position * (scale - 1))
rep.Parent = representation
else
if (obj == workspace) or (((obj.className == "Model") or (obj.className == "Tool") or (obj.className == "Hat")) and (obj ~= representation)) then
local list = obj:GetChildren()
for x = 1, #list do
wait()
makeRepresentation(list[x], cf, name .. "->" .. list[x].Name)
end
end
end
end

local _, t = wait()
print("Making a Small-Map...")
makeRepresentation(workspace, CFrame.new(0, 1.2, 0), "Workspace")
local _2, t2 = wait()
print("Small-Map is done! Time taken: " .. t2 - t .. " seconds.")

This is the script im trying to convert into a scaling tool.

What do i need to do to convert it into a handheld scaling tool.
Report Abuse
InternalRecursion is not online. InternalRecursion
Joined: 30 Dec 2012
Total Posts: 349
09 Sep 2013 03:57 PM
We're not going to just GIVE you the script.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
09 Sep 2013 04:44 PM
I said what i need to add and stuff T_T
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
09 Sep 2013 06:14 PM
BUMP

cmon guys help me, i wont bite
Report Abuse
pj473 is not online. pj473
Joined: 02 Aug 2006
Total Posts: 530
09 Sep 2013 06:54 PM
You are asking for something that is complicated and that no one wants to spend their own time to make it.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
10 Sep 2013 09:33 AM
hmmm, im gonna need a basic model selecting tool to start off.

Anyone know a good one?
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
10 Sep 2013 09:36 AM
I am also to find an object clicked through a tool, not ClickDetector.
It takes lots of time to make a item of your request. Resizing is no problem. But having their position relatively the same as they were before is the problem. Head to the wiki and learn, don't attempt to edit a model that makes no sense to you.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
10 Sep 2013 09:51 AM
I dont have to worry about the position. I can always drag it back.

I think adding and removing a few lines in the script i posted above may work.

Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
10 Sep 2013 09:55 AM
"I think adding and removing few lines in the script i posted above may work."
Lolno. Also if I have to show you a video about what I said above, then I will. I said relative to each other, so
for example:
Model A has 10 bricks in them that are inside each other (merged). And when I resize them, they will go upwards. It's because of Roblox's crappy physics engine. Also considering that MESHES are a possibility in a model, it will take time to resize them down as well. So, as a result, get CmdUtl.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
10 Sep 2013 10:05 AM
Dang....... was hoping that would work.

Anyway thanks for da tips.

And the resize thing would work like how a simple minimap script would work.

Gotta keep editing
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
10 Sep 2013 12:24 PM
plr = game.Players.LocalPlayer

script.Parent.Selected:connect(function()
script.Parent.GUI:clone().Parent = plr.PlayerGui
end)

script.Parent.Deselected:connect(function() --its Unequipped for tools
plr.PlayerGui.GUI:Destroy()
end)

function findparentrecursive(object)
if object.Parent~=game.Workspace then
return object.Parent
end
return object
end

function findchild(object)
for i, v in pairs(game.Workspace:GetChildren()) do
if v==object then return true end
end
return false
end

function findparent(place)
if findparentrecursive(place)==place.Parent then
object = place.Parent
if findchild(object)==false then
repeat
object = findparentrecursive(object)
wait()
until findchild(object)==true
end
return object
else return place end
end


CurrentObject = nil
PositionValue = Vector3.new(0, 0, 0)
RotationValue = Vector3.new(0, 0, 0)
RotationAppearValue = Vector3.new(0,0,0)
player = script.Parent.Parent.Parent


function ModelCFrame(Model, Frame, NewFrame)

-- Declarations --
local MidFrame, GetParts = Vector3.new(0, 0, 0)
local Parts, PartFrames = {}, {}
local midstore = nil
-- Get All Parts --
function GetParts(Object)
if Object:IsA("BasePart") then Parts[#Parts + 1] = Object
elseif #Object:GetChildren() > 0 then
for _, Child in pairs(Object:GetChildren()) do
GetParts(Child)
end
end
end
GetParts(Model)

-- Actually CFrame The Model --
for _, Part in pairs(Parts) do MidFrame = MidFrame + Part.Position end
MidFrame = CFrame.new(MidFrame / #Parts)
for i, Part in pairs(Parts) do PartFrames[i] = MidFrame:toObjectSpace(Part.CFrame) end
MidFrame = NewFrame and Frame or MidFrame * Frame
midstore = MidFrame
for i, Part in pairs(Parts) do Part.CFrame = MidFrame * PartFrames[i] end

end


function GetMFrame(Model, Frame, NewFrame)

-- Declarations --
local MidFrame, GetParts = Vector3.new(0, 0, 0)
local Parts, PartFrames = {}, {}
local midstore = nil
-- Get All Parts --
function GetParts(Object)
if Object:IsA("BasePart") then Parts[#Parts + 1] = Object
elseif #Object:GetChildren() > 0 then
for _, Child in pairs(Object:GetChildren()) do
GetParts(Child)
end
end
end
GetParts(Model)

-- Actually CFrame The Model --
for _, Part in pairs(Parts) do MidFrame = MidFrame + Part.Position end
MidFrame = CFrame.new(MidFrame / #Parts)
for i, Part in pairs(Parts) do PartFrames[i] = MidFrame:toObjectSpace(Part.CFrame) end
return MidFrame
end


repeat wait() until player.Character
function onClicked(target)
if target then
if target.Parent.className=="Model" then
if not target.Locked then

CurrentObject = findparent(target)
selection.Adornee = CurrentObject
selection.Color = BrickColor.new("Bright red")
PositionValue = GetMFrame(CurrentObject).p
local a, b, c = GetMFrame(CurrentObject):toEulerAnglesXYZ()
RotationAppearValue = Vector3.new(math.deg(a), math.deg(b), math.deg(c))
print(RotationAppearValue)
updateGui(PositionValue, RotationAppearValue)
else
CurrentObject = nil
selection.Adornee = nil
selection.Color = BrickColor.Blue()
end
else
CurrentObject = nil
selection.Adornee = nil
selection.Color = BrickColor.Blue()
end
else
CurrentObject = nil
selection.Adornee = nil
selection.Color = BrickColor.Blue()
end end

function onMoved(target)
if not CurrentObject then
if target then
if not target.Locked and target.Parent.className=="Model" then
selection.Adornee = findparent(target)
else
selection.Adornee = nil
end
else
selection.Adornee = nil
end end end


This is the selection part kinda a thing of the script, but it just wont select

What am i missing?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
10 Sep 2013 12:31 PM
Give me... 1E+12 Robux and I will make it for you.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
10 Sep 2013 02:13 PM
ahahaha

As if i even got bc...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image