Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 07 Aug 2015 06:21 PM |
Filtering Enabled is on, but when it isn't it works...
My snippet of code: local function updatehair() for i,v in pairs(characterModel.Character:GetChildren()) do if v.className=="Hat" then v:Destroy() end end local model=game.Lighting.HairObjects:FindFirstChild(tostring(hair)):Clone() model.Handle.Position=characterModel.Character.Head.Position model.Handle.Locked=true model.Parent=characterModel.Character model.Handle.Anchored=false model.Handle.BrickColor=BrickColor.new(colors[haircolor]) model.Name="Hair" end
My whole code:
local colors = {"Br. yellowish green";"Bright yellow";"Bright orange";"Bright red";"Bright violet";"Bright blue";"Bright bluish green";"Bright green";"Institutional white";"White";"Light stone grey";"Mid gray";"Medium stone grey";"Dark stone grey";"Black";"Really black";"Grime";"Br. yellowish orange";"Light orange";"Sand red";"Lavender";"Sand blue";"Medium blue";"Sand green";"Brick yellow";"Cool yellow";"Neon orange";"Medium red";"Light reddish violet";"Pastel Blue";"Teal";"Medium green";"Pastel brown";"Pastel yellow";"Pastel orange";"Pink";"Pastel violet";"Pastel light blue";"Pastel blue-green";"Pastel green";"Olive";"New Yeller";"Neon orange";"Really red";"Hot pink";"Really blue";"Toothpaste";"Lime green";"Brown";"Nougat";"Dark orange";"Royal purple";"Alder";"Cyan";"Light blue";"Camo";"Reddish brown";"CGA brown";"Dusty Rose";"Magenta";"Deep blue";"Navy blue";"Dark green";"Earth green"; } wait(2)
local facebolt=1 local head=1 local metal=1 local torso=1 local tip=1 local hair=1 local haircolor=1 local launcher=1
local Frame=script.Parent:WaitForChild("Frame") local p=game.Players.LocalPlayer local c=p.Character or p.CharacterAdded:wait() local Stats=p:WaitForChild("Stats") local cam=game.Workspace.CurrentCamera
cam:ClearAllChildren()
local characterModel=game.ReplicatedStorage.CharacterModel:Clone() characterModel.Parent=game.Workspace cam.CameraType=Enum.CameraType.Scriptable cam.CoordinateFrame=CFrame.new(characterModel.Character.Torso.Position)*CFrame.new(0,0,10)
mainp = characterModel.Character.Torso mainp:BreakJoints()
for i,v in pairs(characterModel.Character:children()) do if (v:IsA("BasePart") or v:IsA("VehicleSeat")) and v ~= mainp then v:BreakJoints() local w = Instance.new("Motor",v) w.Part0 = mainp w.Part1 = v w.C0 = mainp.CFrame:toObjectSpace(v.CFrame) v.Anchored = false end end
--[[function weld() local parts,last = {} local function scan(parent) for _,v in pairs(parent:GetChildren()) do if (v:IsA("BasePart")) then if (last) then local w = Instance.new("Weld") w.Name = ("%s_Weld"):format(v.Name) w.Part0,w.Part1 = last,v w.C0 = last.CFrame:inverse() w.C1 = v.CFrame:inverse() w.Parent = last end last = v table.insert(parts,v) end scan(v) end end scan(characterModel.Character) for _,v in pairs(parts) do if v.Name~="Torso"then v.Anchored = false end end end
weld()]]
local function CheckId(p1,id) if p1.Handle.Mesh.MeshId==id then return true else return false end end local function updatehair() for i,v in pairs(characterModel.Character:GetChildren()) do if v.className=="Hat" then v:Destroy() end end local model=game.Lighting.HairObjects:FindFirstChild(tostring(hair)):Clone() model.Handle.Position=characterModel.Character.Head.Position model.Handle.Locked=true model.Parent=characterModel.Character model.Handle.Anchored=false model.Handle.BrickColor=BrickColor.new(colors[haircolor]) model.Name="Hair" end local function update() if not characterModel.Character:FindFirstChild("Hair") then updatehair() end print("Character Cleared") --Set the variables if facebolt<1 then facebolt=#colors end if facebolt>#colors then facebolt=1 end if head<1 then head=#colors end if head>#colors then head=1 end if metal<1 then metal=#colors end if metal>#colors then metal=1 end if torso>#colors then torso=1 end if torso<1 then torso=#colors end if tip<1 then tip=#colors end if tip>#colors then tip=1 end if hair<1 then hair=11 end if hair>11 then hair=1 end if haircolor<1 then haircolor=#colors end if haircolor>#colors then haircolor=1 end if launcher<1 then launcher=#colors end if launcher>#colors then launcher=1 end --hair local bey=characterModel.Bey bey.FaceBolt.BrickColor=BrickColor.new(colors[facebolt]) bey.Head.BrickColor=BrickColor.new(colors[head]) bey.Metal.BrickColor=BrickColor.new(colors[metal]) bey.Torso.BrickColor=BrickColor.new(colors[torso]) bey.Tip.BrickColor=BrickColor.new(colors[tip]) for i,v in pairs(characterModel.Launcher:GetChildren()) do v.BrickColor=BrickColor.new(colors[launcher]) end end
update()
for i,v in pairs(Frame:GetChildren()) do if v:FindFirstChild("Left") and v:FindFirstChild("Right") then v.Left.MouseButton1Down:connect(function() if v.Name=="Facebolt" then facebolt=facebolt+1 end if v.Name=="Hair" then hair=hair+1 update() updatehair()end if v.Name=="Hair_Color" then haircolor=haircolor+1 update() updatehair()end if v.Name=="Head" then head=head+1 end if v.Name=="Metal" then metal=metal+1 end if v.Name=="Tip" then tip=tip+1 end if v.Name=="Torso" then torso=torso+1 end if v.Name=="Launcher_Color" then launcher=launcher+1 end update() end) v.Right.MouseButton1Down:connect(function() if v.Name=="Facebolt" then facebolt=facebolt-1 end if v.Name=="Hair" then hair=hair-1 update() updatehair()end if v.Name=="Hair_Color" then haircolor=haircolor-1 update() updatehair()end if v.Name=="Head" then head=head-1 end if v.Name=="Metal" then metal=metal-1 end if v.Name=="Tip" then tip=tip-1 end if v.Name=="Torso" then torso=torso-1 end if v.Name=="Launcher_Color" then launcher=launcher-1 end update() end) end end
Frame:WaitForChild("Finish").MouseButton1Down:connect(function() local stats end)
The problem is that, once the hat is cloned, it falls. No weld is automatically created... |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 06:32 PM |
| the character needs a rootpart i think |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 07 Aug 2015 06:32 PM |
| why does it work with fe off... |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Aug 2015 06:35 PM |
something is obv not being replicated.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 07 Aug 2015 06:36 PM |
It's not obvious to me >.<
What is it |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 06:39 PM |
| try using the drooling zombie as the model |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 07 Aug 2015 06:43 PM |
| Didn't work. Tried on my character also. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
|
| 07 Aug 2015 06:57 PM |
| You realize you can use BrickColor.Random() instead of making a table filled with all the colors right |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 07 Aug 2015 06:57 PM |
| This is a character creation thingy. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 08 Aug 2015 09:41 AM |
Tried on an actual character.
Didn't work.
FilteringEnabled if off and it's parent is Camera. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 08 Aug 2015 09:43 AM |
| It works when it's parented to Workspace. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
|
| 08 Aug 2015 10:20 AM |
| In your game, it appears that the hat position is in front of the character head |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 08 Aug 2015 10:33 AM |
| Position doesn't matter, bump. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
|
| 08 Aug 2015 12:06 PM |
| I have no idea what you just said. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 08 Aug 2015 12:17 PM |
| >The problem is that, once the hat is cloned, it falls. No weld is automatically created. |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2015 12:43 PM |
| Programs-->Delete System 32 |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
| |
|