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: What's wrong with this script?

Previous Thread :: Next Thread 
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
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
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
30 Apr 2014 04:22 PM
Bump please let me know if this is confusing or hard to understand (Same thing?)
Report Abuse
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
30 Apr 2014 05:13 PM
Anyone? :o
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
30 Apr 2014 05:15 PM
Does it update when the number changes?
Report Abuse
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
01 May 2014 03:17 PM
I think so...
Report Abuse
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
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