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: Model won't weld?

Previous Thread :: Next Thread 
masterCameron101 is not online. masterCameron101
Joined: 28 Mar 2010
Total Posts: 1377
01 May 2014 11:43 AM
plr.CharacterAdded:connect(function(character)
char=plr.Character
cc=game.Workspace.CurrentCamera
c1=char:GetChildren()
Instance.new("Model",cc).Name=char.Name
c2=cc[char.Name]:GetChildren()
for i,v in ipairs (c1) do
if v:IsA("Part") and v.Name~="HumanoidRootPart" then
v:Clone().Parent=cc[char.Name]
end
end
for i,v in ipairs (c2) do
w=Instance.new("Weld",game.JointsService)
w.C1=v.CFrame:toObjectSpace(char[v.Name].CFrame)
w.Part0=char[v.Name]
w.Part1=v
end
print("Character Loaded")
plr.CameraMode=Enum.CameraMode.LockFirstPerson
end

The script doesn't even create a weld, why? o.o

~masterCameron101, advanced Lua programmer, certified graphics designer and geek~
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
01 May 2014 12:47 PM
'~masterCameron101, advanced Lua programmer, ' ..

sorry i think your too advanced for help
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
01 May 2014 12:52 PM
I'm guessing this is a localscript. Why do you need the player.CharacterAdded event? Odds are that the Character is already there before the LocalScript even LOADS.
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
01 May 2014 12:55 PM
make it check if a character with health above 0 is there, if so, run the script. if not, use repeat wait() until character and then run the script.
Report Abuse
masterCameron101 is not online. masterCameron101
Joined: 28 Mar 2010
Total Posts: 1377
02 May 2014 08:40 AM
@Translate Advanced users do need help... they're not always going to solve their own errors 100% of the time.

@wazap Localscripts error too. the client opens, loads the game, player loads, error: character = nil, then character loads.

@SenseiWarrior It does it right when the character spawns so there's no need.

~masterCameron101, advanced Lua programmer, certified graphics designer and geek~
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
02 May 2014 09:37 AM
w=Instance.new("Weld",game.JointsService)
w.Part0=char[v.Name]
w.Part1=v
w.C1=v.CFrame:toObjectSpace(char[v.Name].CFrame)

try this i am not sure it will change anything but its worth a try
Report Abuse
masterCameron101 is not online. masterCameron101
Joined: 28 Mar 2010
Total Posts: 1377
02 May 2014 09:45 AM
Outdated code...

~masterCameron101, advanced Lua programmer, certified graphics designer and geek~
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