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: Values, local script.

Previous Thread :: Next Thread 
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
28 Aug 2016 11:48 PM
--This is a local script inside of a Text Button that is inside of a part in workspace.

function gettingfed()
if game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value >= 5 then
game.Players.LocalPlayer.PlayerGui.Hunger.TextLabel.Value.Value = 100
game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value = game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value - 5
else
end
end

script.Parent.MouseButton1Click:connect(gettingfed)

--There are no errors, but the value 100 is not changed. The "WoodPart" value is the amount of wood the player has, they --need five to "get fed". It's not working, does anyone know why and if so could you help me?
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
28 Aug 2016 11:48 PM
script

function gettingfed()
if game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value >= 5 then
game.Players.LocalPlayer.PlayerGui.Hunger.TextLabel.Value.Value = 100
game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value = game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value - 5
else
end
end

script.Parent.MouseButton1Click:connect(gettingfed)
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
28 Aug 2016 11:54 PM
Someone please help.
Report Abuse
pullman45 is not online. pullman45
Joined: 09 Jul 2012
Total Posts: 2891
29 Aug 2016 12:30 AM
Is the TextLabel in a SurfaceGui? It should be.
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
29 Aug 2016 09:43 AM
It is in a surfacegui, yes.
Report Abuse
KillerKyle is online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
29 Aug 2016 10:43 AM
--| game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value = |--

What's this blank spot here?
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
29 Aug 2016 05:46 PM
@Killer, omg, thanks, I'm such a dummy for not seeing that.
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
29 Aug 2016 10:17 PM

--New Script. doesn't work..
function gettingfed()
if game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value >= 5 then
game.Players.LocalPlayer.PlayerGui.Hunger.TextLabel.Value.Value = 100
game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value = game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value - 5
else
end
end

script.Parent.MouseButton1Click:connect(gettingfed)

Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
29 Aug 2016 10:26 PM
Anyone know whats wrong, please.
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