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: Help! :c

Previous Thread :: Next Thread 
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
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
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 11:20 AM
Bumping to the road of victory!
Report Abuse
NeonRiver is not online. NeonRiver
Joined: 12 Feb 2013
Total Posts: 4936
08 Apr 2014 11:24 AM
[ Content Deleted ]
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
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
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 11:51 AM
So weird...
Report Abuse
wazap is not online. 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
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 12:35 PM
K, thanks, wazap.
Report Abuse
Ariophy is not online. Ariophy
Joined: 08 Mar 2014
Total Posts: 81
08 Apr 2014 12:37 PM
xd @bumping to the road of victory
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 12:38 PM
Well, it worked! :D
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
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 is not online. 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
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 01:02 PM
Actually, it says that "Shirt isn't a valid member of Model"
Report Abuse
TexasTech717 is not online. TexasTech717
Joined: 24 Apr 2012
Total Posts: 1129
08 Apr 2014 01:02 PM
Yep, that did it.
Report Abuse
wazap is not online. 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
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