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: Broken .Changed script...

Previous Thread :: Next Thread 
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
25 Jun 2014 11:09 PM
No idea what's wrong.

No output, nothin'.


The value of the parent does change, but the text of the gui doesn't...


function onChanged()
wait(0.5)
if script.Parent:findFirstChild("Value")==true then
for _,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui["Sats"]["Frame"]["Sat1"].Text = "Satellite 1: Armed"
end
elseif script.Parent:findFirstChild("Value")==false then
for _,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui["Sats"]["Frame"]["Sat1"].Text = "Satellite 1: Disarmed"
end
end
end
script.Parent.Changed:connect(onChanged)

Help would be appreciated! Thanks! (:
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
25 Jun 2014 11:15 PM
Bump
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
25 Jun 2014 11:17 PM
Ayeeee
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
25 Jun 2014 11:22 PM
Please help?
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
25 Jun 2014 11:27 PM
...
Report Abuse
Thylord is not online. Thylord
Joined: 19 Feb 2010
Total Posts: 159
25 Jun 2014 11:33 PM
bump because my imbecile friend cant fix it
/jesus4lyfe/
Report Abuse
iJava is not online. iJava
Joined: 06 Mar 2011
Total Posts: 29914
25 Jun 2014 11:35 PM
Here I found the bug
change to this and it should work
v = True
game.workspace.Satellite.Armed = v
if false then
game.workspace.Satellite.Aremed = false

jk
Bump for a friends



~YOSkater
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
25 Jun 2014 11:35 PM
what exactly is script.Parent?
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
25 Jun 2014 11:36 PM
changeAllText = function(texty)
for _,v in pairs(game.Players:GetPlayers()) do
if v.PlayerGui:FindFirstChild("Sats") then
v["Sats"]["Frame"]["Sat1"].Text = texty
end
end
end


script.Parent.Changed:connect(function(steve)
if script.Parent:FindFirstChild("Value") then
changeAllText("Satellite 1: Armed")
elseif not script.Parent:FindFirstChild("Value") then
changeAllText("Satellite 1:Disarmed")
end
end)

Not sure if that'll make a difference, but worth a shot.
Report Abuse
awesomejoker248674 is not online. awesomejoker248674
Joined: 16 Jun 2013
Total Posts: 153
26 Jun 2014 12:34 AM
LOL DUM*
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
26 Jun 2014 12:40 AM
....................




function onChanged()
wait(0.5)
if script.Parent.Value==true then
for _,v in pairs(game.Players:GetPlayers()) do
pcall(function()
v.PlayerGui["Sats"]["Frame"]["Sat1"].Text = "Satellite 1: Armed"
end)
end
else
for _,v in pairs(game.Players:GetPlayers()) do
pcall(function()
v.PlayerGui["Sats"]["Frame"]["Sat1"].Text = "Satellite 1: Disarmed" end)
end
end
end
script.Parent.Changed:connect(onChanged)
Report Abuse
zub74 is not online. zub74
Joined: 13 Sep 2008
Total Posts: 489
26 Jun 2014 12:41 AM
You need to define what's being changed at the beginning of the function.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
26 Jun 2014 09:07 AM
I don't have to... I define it at the end with my connect line...

And also, the parent is a BoolValue. And for those, I just check if it's true or false, yeah?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
26 Jun 2014 09:55 AM
findFirstChild returns an OBJECT not the value of the object you want(in this case bool value)

so just do

if obj.Value then
--it's true
end
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
26 Jun 2014 12:22 PM
did you even try mine
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
26 Jun 2014 07:18 PM
I'm trying it now. I had baseball games in the morning so I could only check the forum, not enough time to test it.
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