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 » Scripters
Home Search
 

Re: Game not work

Previous Thread :: Next Thread 
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 06:47 AM
My game works very well in developer mode,
But when I load it, the button does not work when I press i
Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 06:50 AM
Player = game.Players.LocalPlayer
Character = Player.Character
z = 0

script.Parent.RightArrow.MouseButton1Down:connect(function()
z = z + 1
if z == 1 then
Character.Head.BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character.LowerTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character.UpperTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["LeftUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
Character["RightUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value.Value
script.Parent.Parent.ValueSkinColor.xValue.Value = 1
print(script.Parent.Parent.ValueSkinColor.xValue.Value)
elseif z == 2 then
Character.Head.BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character.LowerTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character.UpperTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["LeftUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
Character["RightUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value2.Value
script.Parent.Parent.ValueSkinColor.xValue.Value = 2
elseif z == 3 then
Character.Head.BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character.LowerTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character.UpperTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["LeftUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
Character["RightUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value3.Value
script.Parent.Parent.ValueSkinColor.xValue.Value = 3
elseif z == 4 then
Character.Head.BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character.LowerTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character.UpperTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["LeftUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
Character["RightUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value4.Value
script.Parent.Parent.ValueSkinColor.xValue.Value = 4
elseif z == 5 then
Character.Head.BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character.LowerTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character.UpperTorso.BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightFoot"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightHand"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightLowerArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightLowerLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightUpperArm"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["LeftUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
Character["RightUpperLeg"].BrickColor = script.Parent.Parent.ValueSkinColor.Value5.Value
z = 0
end
end)
Report Abuse
CelluloidCats is not online. CelluloidCats
Joined: 11 Aug 2015
Total Posts: 841
25 May 2017 06:51 AM
bravo for typing all of that crap which could probably be done in three lines


Report Abuse
greenmaxy is online. greenmaxy
Joined: 15 Jun 2012
Total Posts: 330
25 May 2017 06:52 AM
is it a local script


i have 68,000 pool coins
Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 06:52 AM
How
Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 06:54 AM
No this is a normal script
Report Abuse
greenmaxy is online. greenmaxy
Joined: 15 Jun 2012
Total Posts: 330
25 May 2017 06:56 AM
When you are in studio you can use localplayer but local player will only work in a local script.


i have 68,000 pool coins
Report Abuse
TakeALookInTheMirror is not online. TakeALookInTheMirror
Joined: 25 Dec 2011
Total Posts: 16463
25 May 2017 06:56 AM
First off, you should check out how functions and loops work to make your code shorter/easier to read: wiki.roblox.com/index.php?title=Function
wiki.roblox.com/index.php?title=Loops


Report Abuse
CelluloidCats is not online. CelluloidCats
Joined: 11 Aug 2015
Total Posts: 841
25 May 2017 06:57 AM
this should work in a LocalScript I think

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local z = 0
local ValueSkinColor = script.Parent.Parent:FindFirstChild("ValueSkinColor")
local bodyColorProperties = {"HeadColor", "LeftArmColor", "LeftLegColor", "RightArmColor", "RightLegColor", "TorsoColor"}

script.Parent.RightArrow.MouseButton1Down:connect(function()
z = z + 1
for _, v in pairs(bodyColorProperties) do
Character:FindFirstChild("BodyColors")[v] = ValueSkinColor["Value" .. z].Value
end
end)


Report Abuse
CelluloidCats is not online. CelluloidCats
Joined: 11 Aug 2015
Total Posts: 841
25 May 2017 06:58 AM
for what I wrote to work however you'll have to name the Values as
Value1
Value2
Value3
Value4
...


Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 07:07 AM
There is a error message :

Players.Player1.PlayerGui.CharactersCustom.Skin.RightArrow.LocalScript:10: attempt to index upvalue 'ValueSkinColor' (a nil value)

This line : Character:FindFirstChild("BodyColors")[v] = ValueSkinColor["Value" .. z].Value
Report Abuse
CelluloidCats is not online. CelluloidCats
Joined: 11 Aug 2015
Total Posts: 841
25 May 2017 07:09 AM
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local z = 0
local ValueSkinColor repeat wait() ValueSkinColor = script.Parent.Parent:FindFirstChild("ValueSkinColor") until ValueSkinColor
local bodyColorProperties = {"HeadColor", "LeftArmColor", "LeftLegColor", "RightArmColor", "RightLegColor", "TorsoColor"}

script.Parent.RightArrow.MouseButton1Down:connect(function()
z = z + 1
if z > 5 then z = 0 end
for _, v in pairs(bodyColorProperties) do
Character:FindFirstChild("BodyColors")[v] = ValueSkinColor["Value" .. z].Value
end
end)


Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 07:14 AM
it does nothing
Report Abuse
PointFlash142 is not online. PointFlash142
Joined: 28 Apr 2017
Total Posts: 49
25 May 2017 07:19 AM
wait, There is another error message yet :

Players.Player1.PlayerGui.CharactersCustom.Skin.Script:11: attempt to index a nil value

this line: Character:FindFirstChild("BodyColors")[v] = ValueSkinColor["Value" .. z].Value
Report Abuse
CelluloidCats is not online. CelluloidCats
Joined: 11 Aug 2015
Total Posts: 841
25 May 2017 07:48 AM
probably didn't read that I said you have to rename Value as Value1 for this to work.
learn how to script noob.


Report Abuse
szkiller_dev is not online. szkiller_dev
Joined: 07 Oct 2016
Total Posts: 3572
25 May 2017 08:51 AM
Habe u not seen arrays b0zz
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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