Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't this code work?

Asked by 8 years ago

Basically, when a player dies, the script will check the player's team color and if the team color matches then the respective clothing for that team will be put on you.

Output:

21:23:19.640 - Content failed to parse for http://assetgame.roblox.com/Asset/?id=100808216&serverplaceid=0&clientinsert=0 because Unable to parse XML attributes. '=' not found

Code:


local create = assert(LoadLibrary("RbxUtility")).Create local assetUrl = "http://www.roblox.com/asset/?id=" local marineTeam = "Grime" local japTeam = "Crimson" local assets = { marineTop = 159569221; marineBot = 159569268; japTop = 233325813; japBot = 230563007 } game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character player.CharacterAdded:connect(function(char) local shirt = char:FindFirstChild("Shirt") local pants = char:FindFirstChild("Pants") if player.TeamColor == BrickColor.new(marineTeam) then if shirt then shirt.ShirtTemplate = assetUrl .. assets.marineTop else create("Shirt"){ Name = "Shirt"; ShirtTemplate = assetUrl .. assets.marineTop; Parent = char } end if pants then pants.PantsTemplate = assetUrl .. assets.marineBot else create("Pants"){ Name = "Pant"; PantsTemplate = assetUrl .. assets.marineBot; Parent = char } end elseif player.TeamColor == BrickColor.new(japTeam) then if shirt then shirt.ShirtTemplate = assetUrl .. assets.japTop else create("Shirt"){ Name = "Shirt"; ShirtTemplate = assetUrl .. assets.japTop; Parent = char } end if pants then pants.PantsTemplate = assetUrl .. assets.jatBot else create("Pants"){ Name = "Pants"; PantsTemplate = assetUrl .. assets.japBot; Parent = char } end end end) end)
0
That sounds like a runtime network communication error. I don't get any error on my side, but the script doesn't seem to do much. though. Have you tried restarting Roblox Studio? Link150 1355 — 8y
0
Yes, I have. keitheroni 45 — 8y

Answer this question