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: Help

Previous Thread :: Next Thread 
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:23 AM
while wait() do
if player.pants.Value == 1 then
newpants = Instance.new("Pants", player.Character)
newpants.Name = "Pants"
player.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=174231515"
textgui2 = player.PlayerGui.GameGui.TextLabel
textgui2.Visible = true
textgui2.Text = "Successfully equipped blue assassin pants"
wait(2)
print("good")
textgui2.Visible = false
repeat wait() until
player.pants.Value == 2
end
end

This does not run even if the value is 1.
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
07 Sep 2014 12:30 AM
while wait() do
if player.Pants.Value == 1 then -- CAPITAL P
newpants = Instance.new("Pants", player.Character)
newpants.Name = "Pants"
player.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=174231515"
textgui2 = player.PlayerGui.GameGui.TextLabel
textgui2.Visible = true
textgui2.Text = "Successfully equipped blue assassin pants"
wait(2)
print("good")
textgui2.Visible = false
repeat wait() until
player.pants.Value == 2
end
end
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:32 AM
No its "pants"
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:35 AM
Anyone else gonna try?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:39 AM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:44 AM
BUMP SHUT UP FLOODCHECK
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:47 AM
bump
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
07 Sep 2014 12:47 AM
What type of object is 'pants'? Make sure it is defined properly.

Also, in your loop you have 'repeat wait() until player.pants.Value == 2'.

That will repeat that wait() until it actually equals 2 meaning your while wait() do loop will not run again nor anything else in the script for that matter until pants.Value == 2.
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:49 AM
Pants is a IntValue, and I have no idea what to do to stop pants from being spammed inside the character, so I did that.
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
07 Sep 2014 12:52 AM
On line 2, I just made a check for the PantsTemplate. If it does not equal the pantstemplate that you want, then it creates it. Otherwise if it is already there, it wont continue.

while wait(1/30) do
if player['Character']['Pants'].PantsTemplate ~= "http://www.roblox.com/asset/?id=174231515" then
newpants = Instance.new("Pants", player.Character)
newpants.Name = "Pants"
player.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=174231515"
textgui2 = player.PlayerGui.GameGui.TextLabel
textgui2.Visible = true
textgui2.Text = "Successfully equipped blue assassin pants"
wait(2)
print("good")
textgui2.Visible = false
end
end
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:56 AM
did you test it?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 12:57 AM
The whole thing isnt working
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
07 Sep 2014 12:59 AM
That's for you to do. I don't have a place set up the way you do to test it in the proper environment. Syntax wise, the code should be fine, but you need to test it to see if it meets your needs.
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:00 AM
My original code didnt work, and neither did yours. I'm asking how would I fix it?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:01 AM
bump
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
07 Sep 2014 01:06 AM
Where there any errors?

Is there by any chance that you're not removing the original pants that the player or you may have?

Try this:

while wait(1/30) do
if player.Character:WaitForChild('Pants').PantsTemplate ~= "http://www.roblox.com/asset/?id=174231515" then
newpants = Instance.new("Pants", player.Character)
newpants.Name = "Pants"
player.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=174231515"
textgui2 = player.PlayerGui.GameGui.TextLabel
textgui2.Visible = true
textgui2.Text = "Successfully equipped blue assassin pants"
wait(2)
print("good")
textgui2.Visible = false
end
end
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:07 AM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:08 AM
I destroyed the original shirt and there are no errors
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:12 AM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:23 AM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:29 AM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 01:35 AM
anyone?
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
07 Sep 2014 01:43 AM
Use the breakpoints in the code editor in studio, or make prints throughout the script to how far it is getting.
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
07 Sep 2014 02:15 AM
it doesnt run at all.
Report Abuse
TehGabeNewell is not online. TehGabeNewell
Joined: 07 Feb 2013
Total Posts: 3165
07 Sep 2014 02:22 AM
i always use boolvalues in loops, heres an example

while wait() do
if game.Workspace.alreadyplayedsound.Value == false then
game.Workspace.alreadyplayedsound.Value = true
part = Instance.new("Part")
part.Parent = Workspace
end
game.Workspace.FilteringEnabled = true
end

idk just random example
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