|
| 02 Jan 2014 09:15 AM |
I want a script that automatically gives you a certain shirt (the shirt in the second if statement) if you are not wearing one of the allowed shirts (the shirts in the first if statement). Can you make me one?
Do I have to add onPlayerAdded? If so how?
Here's what I have so far:
while true do for _,v in pairs(Workspace:GetChildren()) do if v:findFirstChild("Shirt") ~= nil then if v.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=122953212" or v.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=139728805" or v.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=73800548" or v.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=93903178" then v.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=122953212" end end end wait() end
|
|
|
| Report Abuse |
|
|
|
| 02 Jan 2014 09:40 AM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Shirt") if character.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=122953212" and character.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=139728805" and character.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=73800548" and character.Shirt.ShirtTemplate ~= "http://www.roblox.com/asset/?id=93903178" then character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=122953212" end end) end)
That should work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jan 2014 10:01 AM |
Well what happened when you tried running it?
Any output? Did it run, but didn't have the same result you wanted? |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 02 Jan 2014 10:16 AM |
| .PlayerAdded dosent work in solo test, insted do "Start server"> "StartPlayer" |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2014 05:31 PM |
Heres the output:
18:30:44.745 - DataModel Loading http://www.roblox.com/asset/?id=136310534 18:30:44.745 - https://api.roblox.com/auth/negotiate?ticket=76eb0e0ebedc40b897d55e3d189733d1: err=0x193 (403) 18:30:58.968 - httpGet http://www.roblox.com/Asset/?id=100808216&serverplaceid=0 failed. Trying again. Error: http://www.roblox.com/Asset/?id=100808216&serverplaceid=0: err=0x193 (403). Elapsed time: 0.140697 18:30:59.033 - Content failed for http://www.roblox.com/Asset/?id=100808216&serverplaceid=0 because http://www.roblox.com/Asset/?id=100808216&serverplaceid=0: err=0x193 (403) |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jan 2014 07:08 PM |
| I will bump this every day and night till someone answers my question!!!! |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jan 2014 08:01 PM |
local shirtIds = { ['73800548'] = true; ['93903178'] = true; ['122953212'] = true; ['139728805'] = true; }
game:GetService('Players').PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) if (not shirtIds[c.Shirt.ShirtTemplate:match('%d+')]) then v.Shirt.ShirtTemplate = 'http://www.roblox.com/asset/?id=122953212' end end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jan 2014 08:39 PM |
M bad, forgot to change something.
local shirtIds = { ['73800548'] = true; ['93903178'] = true; ['122953212'] = true; ['139728805'] = true; }
game:GetService('Players').PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) if (not shirtIds[c.Shirt.ShirtTemplate:match('%d+')]) then p.Shirt.ShirtTemplate = 'http://www.roblox.com/asset/?id=122953212' end end) end) |
|
|
| Report Abuse |
|
|