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
 

MORPH PROBLEMS PLEASE HELP

Previous Thread :: Next Thread 
battlespec16 is not online. battlespec16
Joined: 06 Dec 2010
Total Posts: 224
07 Jun 2014 10:30 PM
HOW DO I CHANGE THIS SO THAT IT MORPHS PEOPLE INTO ITEMS THAT HAVE ARM1, ARM2, CHEST, LEG1 AND LEG2, AND THE MODEL HAS NO HEAD EITHER, IT'S ALL MADE UP OF BRICKS AND THE HEAD OBJECT IS IT THE CHEST




function WaitForItem(Location, Item)
while (Location:FindFirstChild(Item) == nil) do wait(1) end
return Location:FindFirstChild(Item)
end

-- Setup
local StealthLava = script.Parent.Parent
local Hold = nil

local HatAttachmentForward = WaitForItem(script, "HatAttachmentForward")
local HatAttachmentPos = WaitForItem(script, "HatAttachmentPos")
local HatAttachmentRight = WaitForItem(script, "HatAttachmentRight")
local HatAttachmentUp = WaitForItem(script, "HatAttachmentUp")
local HatMeshId = WaitForItem(script, "HatMeshId")
local HatName = WaitForItem(script, "HatName")
local HatScale = WaitForItem(script, "HatScale")
local HatSize = WaitForItem(script, "HatSize")
local HatTextureId = WaitForItem(script, "HatTextureId")
local HatVertexColor = WaitForItem(script, "HatVertexColor")
local HatformFactor = WaitForItem(script, "HatformFactor")

-- Functions
function SpawnHat()
if (Hold ~= nil) or (StealthLava.ClassName ~= "Model") then return end
Hold = true

local p = Instance.new("Part")
p.Name = "Handle"
p.BrickColor = BrickColor.new("Medium stone grey")
p.CanCollide = false
p.Locked = true
p.formFactor = 0
p.BackSurface = 0
p.BottomSurface = 0
p.FrontSurface = 0
p.LeftSurface = 0
p.RightSurface = 0
p.TopSurface = 0

local m = Instance.new("SpecialMesh")
m.Name = "Mesh"
m.Parent = p

local h = Instance.new("Hat")
h.Name = HatName.Value
h.AttachmentForward = HatAttachmentForward.Value
h.AttachmentPos = HatAttachmentPos.Value
h.AttachmentRight = HatAttachmentRight.Value
h.AttachmentUp = HatAttachmentUp.Value
m.MeshId = HatMeshId.Value
m.TextureId = HatTextureId.Value
m.Scale = HatScale.Value
m.VertexColor = HatVertexColor.Value
p.formFactor = HatformFactor.Value
p.Size = HatSize.Value
p:Clone().Parent = h
h.Parent = StealthLava

Hold = nil
end

SpawnHat()
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