|
| 19 Nov 2017 07:57 AM |
| Anyone know how I can make a "grow" script like many simulator games use? |
|
|
| Report Abuse |
|
farizarps
|
  |
| Joined: 22 Aug 2014 |
| Total Posts: 27 |
|
|
| 19 Nov 2017 08:01 AM |
| Try using CloneTrooper1019's character scale script: ################################### May the mass times acceleration be with you. |
|
|
| Report Abuse |
|
farizarps
|
  |
| Joined: 22 Aug 2014 |
| Total Posts: 27 |
|
|
| 19 Nov 2017 08:30 AM |
| #### ## / J2wxNz May the mass times acceleration be with you. |
|
|
| Report Abuse |
|
farizarps
|
  |
| Joined: 22 Aug 2014 |
| Total Posts: 27 |
|
|
| 19 Nov 2017 08:32 AM |
Here it is:
function scaleCharacter(model,scale) if not model or not scale then return end if not _G.ScaleCons then _G.ScaleCons = {} end if _G.ScaleCons[model] then _G.ScaleCons[model]:disconnect() end local joints = {} local parts = {} local h = model:findFirstChild("Humanoid") if h then h.Parent = nil end local function handleHat(hat) if hat:findFirstChild("GotScaled") then return end Instance.new("Flag",hat).Name = "GotScaled" Spawn(function () local h = hat:WaitForChild("Handle") local m = h:WaitForChild("Mesh") m.Scale = m.Scale * scale end) local yInc = (scale-1)*.5 hat.AttachmentPos = (hat.AttachmentPos * scale) - (hat.AttachmentUp * Vector3.new(yInc,yInc,yInc)) end for _,v in pairs(model:GetChildren()) do if v:IsA("BasePart") then table.insert(parts,v) v.Anchored = true; v.FormFactor = "Custom"; for _,j in pairs(v:GetChildren()) do if j:IsA("Motor6D") then local t = { Name = j.Name; Parent = v; Part0 = j.Part0; Part1 = j.Part1; C0## #.##### # C1## #.##### } table.insert(joints,t) j:Destroy() end end elseif v:IsA("Hat") then handleHat(v) end end for _,v in pairs(parts) do #v.Size = v.Size * scale v.Anchored = false end for _,j in pairs(joints) do local c0 = {j.C0:components()} local c1## #j################### for i = 1,3 do c0[i] = c0[i] * scale c1[i] = c1[i] * scale end j.C0 = CFrame.new(unpack(c0)) j.#### CFrame.new(unpack(c1)) local n = Instance.new("Motor6D") for k,v in pairs(j) do n[k] = v
end end model.ChildAdded:connect(function (c) if c:IsA("Hat") then handleHat(c) end end) if h then h.Parent = model h.WalkSpeed = 16 * scale h.MaxHealth = 100 * scale h.Health = (h.Health/h.MaxHealth)*(100*scale) end _G.ScaleCons[model] = con end
Hope this helps
May the mass times acceleration be with you. |
|
|
| Report Abuse |
|
|
| 19 Nov 2017 08:36 AM |
| Oh thanks! Some of it it tagged tho? |
|
|
| Report Abuse |
|