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 » Scripters
Home Search
 

Re: Completely clueless on how to script

Previous Thread :: Next Thread 
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 07:52 PM
This was working yesterday, but now it isn't. When a character first joins, they still have their hats on. When they reset, the script works fine. Can someone help me out? v

game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
playerinplayers.CanLoadCharacterAppearance = false
plr.Head.face.Texture = "rbxassetid://110490566"
local shirt = Instance.new('Shirt', plr)
shirt.ShirtTemplate = "rbxassetid://416432753"
local pants = Instance.new('Pants', plr)
pants.PantsTemplate = "rbxassetid://416432805"
local bodycolors = Instance.new("BodyColors", plr)
bodycolors.RightArmColor = BrickColor.new("Really black")
bodycolors.LeftArmColor = BrickColor.new("Really black")
bodycolors.LeftLegColor = BrickColor.new("Really black")
bodycolors.RightLegColor = BrickColor.new("Really black")
bodycolors.TorsoColor = BrickColor.new("Really black")
bodycolors.HeadColor = BrickColor.new("Really black")
end
end)
Report Abuse
ReynnSolaris is not online. ReynnSolaris
Joined: 16 Jun 2013
Total Posts: 1345
08 Aug 2016 07:54 PM
game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
repeat wait(0.45) until plr.Humanoid~= nil
playerinplayers.CanLoadCharacterAppearance = false
plr.Head.face.Texture = "rbxassetid://110490566"
local shirt = Instance.new('Shirt', plr)
shirt.ShirtTemplate = "rbxassetid://416432753"
local pants = Instance.new('Pants', plr)
pants.PantsTemplate = "rbxassetid://416432805"
local bodycolors = Instance.new("BodyColors", plr)
bodycolors.RightArmColor = BrickColor.new("Really black")
bodycolors.LeftArmColor = BrickColor.new("Really black")
bodycolors.LeftLegColor = BrickColor.new("Really black")
bodycolors.RightLegColor = BrickColor.new("Really black")
bodycolors.TorsoColor = BrickColor.new("Really black")
bodycolors.HeadColor = BrickColor.new("Really black")
end
end)


Report Abuse
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 07:59 PM
Didn't work.
Report Abuse
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 08:02 PM
I also have this script running. Is that messing with it? It wasn't before.

local hat = 69434624
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
asset = game:GetService("InsertService"):LoadAsset(hat)
give = game:GetService("InsertService"):Insert(asset)
local children = asset:GetChildren()
for i = 1, #children do
children[i].Parent = character
end
end)
end)
Report Abuse
radioactivated is not online. radioactivated
Joined: 05 Sep 2009
Total Posts: 1181
08 Aug 2016 08:18 PM
Rather than using ChildAdded in workspace, you should use CharacterAdded within the PlayerAdded block.
Report Abuse
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 08:30 PM
Can you elaborate on that a bit more? I don't really know how to script. I've been looking at youtube tutorials.
Report Abuse
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 08:30 PM
OH you mean in the hat script. Got it.
Report Abuse
troyqaz is not online. troyqaz
Joined: 22 Jan 2009
Total Posts: 1713
08 Aug 2016 08:31 PM
Nevermind. I'm real confused.
Report Abuse
radioactivated is not online. radioactivated
Joined: 05 Sep 2009
Total Posts: 1181
09 Aug 2016 09:59 AM
game.Players.PlayerAdded:connect(function(plr)
-- do stuff related to the player, but NOT the character
plr.CharacterAdded:connect(function(char)
-- do stuff related to the player's CHARACTER
-- in your case, that involves giving the hat

This would go in a script somewhere on the server. I prefer the ServerScriptService.
Report Abuse
Stewie141 is not online. Stewie141
Joined: 21 Aug 2015
Total Posts: 11
09 Aug 2016 10:00 AM
Lol, I just found a new functiony thing: CharacterAdded. Thanks to the guy above me for saying that does stuff to your character, just what I needed for a new auto uniform script!


~Stewie140
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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