jhonathan
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 67 |
|
|
| 30 Jul 2011 01:48 AM |
| I have made a large scale model of a gun and need a minimap script. I have used some others in free models, but they don't let the wedges appear. I'm not a free modeler! I only use them when things get too complicated for me such as scripts like this. If you could please help me. |
|
|
| Report Abuse |
|
|
| |
|
jhonathan
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 67 |
|
| |
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 30 Jul 2011 03:43 AM |
If you see in the script if part.className = "Part" or part.className = "Hat" or something, replace it all with if part:IsA("BasePart") |
|
|
| Report Abuse |
|
|
jhonathan
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 67 |
|
|
| 30 Jul 2011 04:05 AM |
| Let me throw this out. I'm a noob when it comes to scripting. I'm a 100 percent builder. I can follow tutorials on stuff, but I just get confused when I try scripting. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
| |
|
jhonathan
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 67 |
|
|
| 30 Jul 2011 04:47 PM |
scale = 1 / 20
local representation = Instance.new("Model") representation.Parent = script.Parent representation.archivable = false representation.Name = "Minimap"
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 = false 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 mini-map...") makeRepresentation(workspace, CFrame.new(0, 1.2, 0), "Workspace") local _2, t2 = wait() print("Mini-map is done! Time taken: " .. t2 - t .. " seconds.")
Again this is not mine. I cannot script. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 31 Jul 2011 01:47 AM |
Until this moment, I had absolutley no idea what a minimap was. It seems like a good way to create gun models, thank you kind Sir for showing me :P Anyway, this script would be need to changed QUITE a bit in order to work with wedge meshes. It works by using block meshes, which don't work in a wedge. As an alternative, could you instead CFrame a part so it's like a wedge?
Try part = Workspace.Handle2 part.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)
Here we have math.pi/2 as 1/4 of a turn along the Yaw axis. If you want to move things:
part = Workspace.Handle2 part.CFrame = part.CFrame * CFrame.new(0,1,0)
Here we have 1 as 1 along the Y axis. Just like regular positioning, except it allows bricks to go inside other bricks if both are anchored. Useful for weapon making.
Sorry I couldn't help with what you wanted :C |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2011 03:00 AM |
| Look off of ROBLOX's radar gear item |
|
|
| Report Abuse |
|
|
jhonathan
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 67 |
|
|
| 31 Jul 2011 05:08 AM |
| Yess!!! my pistol came out great! I c-framed it just like you said and I like how it turned out! I'll just follow a tutorial on how to make it raycast and it will be done. |
|
|
| Report Abuse |
|
|