|
| 30 Apr 2014 04:12 PM |
I want to be able to step on a block and update a block surface gui with a number value so that when you touch a block it increases the number on the gui by 1 I'll list the explorer. _____________________________________________________ Script _____________________________________________________ x=game.Workspace.Part.SurfaceGui.textbox1 x.Text = x.omg.Value
Part SurfaceGui TextBox textbox1 omg
Part Script _______________________________________________________ function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then x=hit.Parent:FindFirstChild("Humanoid") if x==true then do print("Testing1") game.Workspace.Part.SurfaceGui.textbox1.omg.Value = game.Workspace.Part.SurfaceGui.textbox1.omg.Value + 1 print("Testing2") end end end end
script.Parent.Touched:connect(onTouched)
ALSO NONE OF THE PRINTS PRINT IN THE OUPUT. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 04:22 PM |
| Bump please let me know if this is confusing or hard to understand (Same thing?) |
|
|
| Report Abuse |
|
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 30 Apr 2014 05:15 PM |
| Does it update when the number changes? |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 May 2014 03:18 PM |
I did put
function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then x=hit.Parent:FindFirstChild("Humanoid") if x==true then do print("Testing1") game.Workspace.Part.SurfaceGui.textbox1.omg.Value = game.Workspace.Part.SurfaceGui.textbox1.omg.Value + 1 print("Testing2") end end end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 01 May 2014 03:21 PM |
Not sure why you won't update it directly, try this
x=game.Workspace.Part.SurfaceGui.textbox1 x.Text = x.omg.Value
x.omg.Changed:connect(function(Value) x.Text = Value end)
function onTouched(hit) if Game.Players:GetPlayerFromCharacter(hit.Parent) then x.omg.Value = x.omg.Value + 1 end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|