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: Outfit Swapper

Previous Thread :: Next Thread 
ChaosEspeon is not online. ChaosEspeon
Joined: 02 Jan 2009
Total Posts: 4578
07 Apr 2014 01:07 PM
I have this script that works with the mannequin. The mannequin can switch between eight different "outfits," and works with two buttons. When you open one outfit, there is a button you click that makes the mannequin wear your outfit, and another button that makes you wear the mannequin's outfit. It works the same way with all eight outfits.

Here's the problem:
It doesn't work online. For some reason, when I test it in ROBLOX Studio, it works. But the second I actually try it in-game, it doesn't. Any ideas why?

PS: There is no output given whatsoever. Not online or offline.


Here's the script:


local set = script.Parent.SetButton.ClickDetector
local wear = script.Parent.WearButton.ClickDetector

local outfitA = script.Parent.outfitA
local outfitB = script.Parent.outfitB
local outfitC = script.Parent.outfitC
local outfitD = script.Parent.outfitD
local outfitE = script.Parent.outfitE
local outfitF = script.Parent.outfitF
local outfitG = script.Parent.outfitG
local outfitH = script.Parent.outfitH

local mannequin = script.Parent.Mannequin
local CurrentOutfit = outfitA

outfitA.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitA

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitB.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitB

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitC.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitC

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitD.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitD

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitE.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitE

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitF.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitF

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitG.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitG

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

outfitH.ClickDetector.MouseClick:connect(function(plr)
CurrentOutfit = outfitH

mannequin.Pants.PantsTemplate = CurrentOutfit.Pants.PantsTemplate
mannequin.Shirt.ShirtTemplate = CurrentOutfit.Shirt.ShirtTemplate
end)

set.MouseClick:connect(function(plr)
local chr = plr.Character

if chr:findFirstChild("Pants") then
mannequin.Pants.PantsTemplate = chr.Pants.PantsTemplate
CurrentOutfit.Pants.PantsTemplate = chr.Pants.PantsTemplate
else
mannequin.Pants.PantsTemplate = ""
CurrentOutfit.Pants.PantsTemplate = ""
end

if chr:findFirstChild("Shirt") then
mannequin.Shirt.ShirtTemplate = chr.Shirt.ShirtTemplate
CurrentOutfit.Shirt.ShirtTemplate = chr.Shirt.ShirtTemplate
else
mannequin.Shirt.ShirtTemplate = ""
CurrentOutfit.Shirt.ShirtTemplate = ""
end
end)

wear.MouseClick:connect(function(plr)
local chr = plr.Character

if chr:findFirstChild("Pants") then
chr.Pants.PantsTemplate = mannequin.Pants.PantsTemplate
else
local pants = Instance.new("Pants", chr)
pants.Name = "Pants"
pants.PantsTemplate = mannequin.Pants.PantsTemplate
end

if chr:findFirstChild("Shirt") then
chr.Shirt.ShirtTemplate = mannequin.Shirt.ShirtTemplate
else
local shirt = Instance.new("Shirt", chr)
shirt.Name = "Shirt"
shirt.ShirtTemplate = mannequin.Shirt.ShirtTemplate
end
end)
Report Abuse
ChaosEspeon is not online. ChaosEspeon
Joined: 02 Jan 2009
Total Posts: 4578
07 Apr 2014 02:07 PM
Anyone? ;/
Report Abuse
ChaosEspeon is not online. ChaosEspeon
Joined: 02 Jan 2009
Total Posts: 4578
07 Apr 2014 09:51 PM
No one? :/
Report Abuse
ChaosEspeon is not online. ChaosEspeon
Joined: 02 Jan 2009
Total Posts: 4578
07 Apr 2014 10:57 PM
I seriously can't find a single issue...
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