|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 29 Aug 2016 09:43 AM |
| It is in a surfacegui, yes. |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2016 10:43 AM |
--| game.Workspace.WoodPart.SurfaceGui.TextLabel.Value.Value = |--
What's this blank spot here? |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2016 05:46 PM |
| @Killer, omg, thanks, I'm such a dummy for not seeing that. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 29 Aug 2016 10:26 PM |
| Anyone know whats wrong, please. |
|
|
| Report Abuse |
|
|