|
| 08 Apr 2014 11:09 AM |
So, I'm trying to make it so that when the player joins the game, his appearance is set to a certain player and a LocalScript gets given to him in his StarterGui. However, the shirt and pants only work for one player. Everyone else gets the Infernus, but only one player gets the clothing.
plyr = script.Parent.Parent plyrN = plyr.Name
repeat wait() until game.Workspace:FindFirstChild(plyrN) local char = game.Workspace:FindFirstChild(plyrN)
repeat wait() until char:findFirstChild("Shirt") local shirt = char:findFirstChild("Shirt") shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=127094495"
repeat wait() until char:FindFirstChild("Pants") local pants = char:FindFirstChild("Pants") pants.PantsTemplate = "http://www.roblox.com/asset/?id=43472819"
char:FindFirstChild("GlassesYellowAndBlack"):remove() char:FindFirstChild("Skater"):remove() char:FindFirstChild("MessyHair"):remove() char.Head.face:remove() game.Lighting.Infernus:clone().Parent = char.FakeHead |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2014 11:20 AM |
| Bumping to the road of victory! |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
|
| 08 Apr 2014 11:32 AM |
Ok, my problem isn't what I said, now. I just realized that everyone looks the same, but it's different from each player's perspective! Like, their own character is dressed right, but the other players aren't (just the Infernus). On each screen. So, I started a three player server and THEIR person looked the same from their viewpoint, but other players didn't.
I've never seen this before. |
|
|
| Report Abuse |
|
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 12:24 PM |
Its the client/server communication thing. Once a character's shirt/pants have loaded, the client pretty much ignores any further changes to clothing from the server side. To fix this, what you would have to do is 1. Destroy your current shirt/pants 2. Instance.new("Shirt") --Important, DO NOT PARENT IT TO THE CHARACTER YET 3. Set the shirt/Pants Texture to desired look 4. NOW PARENT IT TO CHARACTER |
|
|
| Report Abuse |
|
|
| |
|
Ariophy
|
  |
| Joined: 08 Mar 2014 |
| Total Posts: 81 |
|
|
| 08 Apr 2014 12:37 PM |
| xd @bumping to the road of victory |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Apr 2014 12:59 PM |
Didn't work after all. No output. :/ (btw, It's a LocalScript in PlayerGUI)
repeat wait() until game.Workspace:FindFirstChild(plyrN) char = game.Workspace:FindFirstChild(plyrN)
char.Shirt:remove() char.Pants:remove() local shirt = Instance.new("Shirt") shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=127094495" shirt.Parent = char
local shirt = Instance.new("Pants") pants.PantsTemplate = "http://www.roblox.com/asset/?id=43472819" pants.Parent = char
char:FindFirstChild("GlassesYellowAndBlack"):remove() char:FindFirstChild("Skater"):remove() char:FindFirstChild("MessyHair"):remove() char.Head.face:remove() game.Lighting.Infernus:clone().Parent = char.FakeHead |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 01:01 PM |
Ummm wait a bit before executing this code.
This script and the server are pretty much competing to put clothes on the character at this time Add in like a wait(1) after the repeat--until line. |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2014 01:02 PM |
| Actually, it says that "Shirt isn't a valid member of Model" |
|
|
| Report Abuse |
|
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 01:03 PM |
Check if the character actually has a shirt on...
if char:FindFirstChild("Shirt") then char.Shirt:Destroy() end
Alternatively
pcall(function() char.Shirt:Destroy() end) |
|
|
| Report Abuse |
|
|