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] Put a Hat on a Group Member?

Previous Thread :: Next Thread 
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 07:11 AM
Hi everyone!

How do you put a hat on someone who is in your group? I have tried many times and it hasn't worked. Please can you help?

BTW, I am new to the forums and a rookie in Lua :)
Report Abuse
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
06 Sep 2014 07:20 AM
Well, I don't weld that much but you would to do like:

game.Players.PlayerAdded:connect(function(plr)
if plr:IsInGroup(000000) then
hat = Instance.new("Hat")
hat.Parent = plr
end)
Report Abuse
vlekje518 is not online. vlekje518
Joined: 10 Apr 2011
Total Posts: 191
06 Sep 2014 07:22 AM
local GROUPID = GROUPIDHERE
local Hat = Game:GetService("ServerStorage"):WaitForChild("GroupHat") -- Place your hat in ServerStorage and name it "GroupHat" -- with capitals!

Game:GetService("Players").PlayerAdded:connect(function(Player)
local GroupPerson = false
if Player:IsInGroup(GROUPID) then
GroupPerson = true
end
Player.CharacterAdded:connect(function(Character)
if GroupPerson then
Hat:Clone().Parent = Character
end
end)
end)
Report Abuse
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
06 Sep 2014 07:23 AM
Yeah go with his lol, mine was more of a MadeFromScratch approach, his is a little more for beginners.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 07:30 AM
Alright, thanks guys.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 07:42 AM
Hmm. It dunt work for both
Report Abuse
DragonClan488 is not online. DragonClan488
Joined: 29 Nov 2012
Total Posts: 291
06 Sep 2014 07:44 AM
I have a same problem but I want that a certain rank gets a certain hat.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 07:44 AM
I want it for everyone in the group.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 09:01 AM
b2
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 09:13 AM
b3
Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
06 Sep 2014 09:15 AM
local hatname = 'NAME';
local groupid = IDHERE;

-- Put the hat in ServerStorage

game.Players.PlayerAdded:connect(function(p)
if p:IsInGroup(groupid) then
p.CharacterAdded:connect(function(c)
local hat = game.ServerStorage[hatname]:Clone();
if hat then
hat.Parent = c;

local weld = Instance.new('Weld', hat);
weld.Part0 = hat;
weld.Part1 = c.Head;
hat.Handle.CFrame = c.Head.CFrame + Vector3.new(0, 1, 0); -- play around with this;

end;
end);
end;
end);
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 09:20 AM
Nothing's appearing on my head :(
Report Abuse
DragonClan488 is not online. DragonClan488
Joined: 29 Nov 2012
Total Posts: 291
06 Sep 2014 09:31 AM
is this a local script?
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 10:11 AM
I wondered that... is it guys?
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 10:21 AM
Tested it, and no, doesnt work in a localscript.
Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
06 Sep 2014 10:40 AM
Test it ingame, not solo.
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
06 Sep 2014 12:34 PM
I always test ingame, and has never worked.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
06 Sep 2014 01:30 PM
print("VLEKJE513_Started")
local GROUPID = GROUPIDHERE
local Hat = Game:GetService("ServerStorage"):WaitForChild("GroupHat") -- Place your hat in ServerStorage and name it "GroupHat" -- with capitals!
print("VLEKJE513_"..Hat)
Game:GetService("Players").PlayerAdded:connect(function(Player)
local GroupPerson = false
if Player:IsInGroup(GROUPID) then
GroupPerson = true
end
Player.CharacterAdded:connect(function(Character)
if GroupPerson then
Hat:Clone().Parent = Character
end
end)
end)


^ get that script and tell me what the VLEKJE513_ things say
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
06 Sep 2014 02:17 PM
local loadout_hats={id1;id2;id3;etc;}; -- can be assetId or asset
local _group=idofgrouphere;
game.Players.PlayerAdded:connect(function(a)
if(a:isInGroup(_group))then
a.CharacterAdded:connect(function(aa)
for i,v in pairs(loadout_hats)do
game:service'InsertService':loadAsset(v):children''[1].Parent=aa;
end;end);else pcall(a:breakJoints'');end;end);
Report Abuse
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
07 Sep 2014 11:13 AM
Bump :3
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
07 Sep 2014 11:48 AM
@analyse That don't work either.

We needz pro script0r to fix our problemo!
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
07 Sep 2014 12:40 PM
works fine for me
Report Abuse
alvin1104 is not online. alvin1104
Joined: 22 Feb 2011
Total Posts: 681
08 Sep 2014 03:07 PM
What are you doing it with?

Script or Localscript?
Studio test or Game Test?

What game did you test it in?
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
09 Sep 2014 12:50 AM
my own
online and solo with some group im in
jokes on you
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
09 Sep 2014 12:51 AM
Well I made a part when touched if in group it gives you a tool, lol, as a LocalScript
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