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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 06 Sep 2014 07:42 AM |
Hmm. It dunt work for both
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 06 Sep 2014 07:44 AM |
| I want it for everyone in the group. |
|
|
| Report Abuse |
|
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
| |
|
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
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 06 Sep 2014 09:20 AM |
| Nothing's appearing on my head :( |
|
|
| Report Abuse |
|
|
| |
|
alvin1104
|
  |
| Joined: 22 Feb 2011 |
| Total Posts: 681 |
|
|
| 06 Sep 2014 10:11 AM |
| I wondered that... is it guys? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|