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: HELP ME, SCRIPT WONT WORK

Previous Thread :: Next Thread 
bluehunter577 is not online. bluehunter577
Joined: 06 Feb 2009
Total Posts: 66
06 Jul 2017 11:02 PM
ok so i cant figure out why this wont work, im trying to change the transparency when the tool is activated, but it wont work, if tried every debugging method i know but i cant figure it out

tool = script.Parent
handle = tool.Handle
uppertorso = game.Players.LocalPlayer.Character.UpperTorso
tool.Activated:connect(function()
if uppertorso.Transparency == 0 then
print("it got to line 6")
uppertorso.Transparency = 0.5
print("it got paste changing the transparency")
else
uppertorso.Transparency = 0
end
end)
Report Abuse
bluehunter577 is not online. bluehunter577
Joined: 06 Feb 2009
Total Posts: 66
06 Jul 2017 11:03 PM
lmao mis spelled past on the print
Report Abuse
TheCoderOfLua is not online. TheCoderOfLua
Joined: 12 Apr 2016
Total Posts: 1599
06 Jul 2017 11:04 PM
tool = script.Parent
handle = tool.Handle
uppertorso = game.Players.LocalPlayer.Character.Torso
tool.Activated:connect(function()
if uppertorso.Transparency == 0 then
print("it got to line 6")
uppertorso.Transparency = 0.5
print("it got paste changing the transparency")
else
uppertorso.Transparency = 0
end
end)



that oughta work
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
06 Jul 2017 11:06 PM
@Coder, he is probably using R15. I'd imagine if it had to be Torso instead of UpperTorso, he would have caught that error already.

Are you using a LocalScript?
What sort of output are you getting?
Report Abuse
bluehunter577 is not online. bluehunter577
Joined: 06 Feb 2009
Total Posts: 66
06 Jul 2017 11:08 PM
yes im using r15, and im not getting any errors in the output and yes im using localscript
Report Abuse
KiwiTronik is not online. KiwiTronik
Joined: 18 Feb 2010
Total Posts: 3221
06 Jul 2017 11:08 PM
I read something in a wiki about the transparency's aren't actually exactly 0 and is about .0333+

Maybe find a different way to check it?
Have a number value that gets set by whatever is changing the transparency.
Report Abuse
bluehunter577 is not online. bluehunter577
Joined: 06 Feb 2009
Total Posts: 66
06 Jul 2017 11:11 PM
tried printing to see if it was anything else, didnt work, usally does in past experience
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
06 Jul 2017 11:18 PM
It might not be the immediate fix, but if you define your variable for the UpperTorso outside of the event, won't this value be nullified when the character dies/respawns? Try indexing the UpperTorso within the Activated event:

uppertorso = tool.Parent:FindFirstChild("UpperTorso")
Report Abuse
KiwiTronik is not online. KiwiTronik
Joined: 18 Feb 2010
Total Posts: 3221
06 Jul 2017 11:19 PM
use :WaitForChild() just to be sure ;)
Report Abuse
bluehunter577 is not online. bluehunter577
Joined: 06 Feb 2009
Total Posts: 66
07 Jul 2017 10:24 AM
sorry for such late reply, but thanks, yall helped me figured it out, since the script is loading faster than my character can load, its making the variable nil, so i just put the variable into the function
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