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: Detects if a value of a string value has changed.

Previous Thread :: Next Thread 
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
15 Oct 2015 01:42 PM
The .Changed:connect event doesn't seem to be working here.

#code
while true do
wait(1)
Seconds.Changed:connect(function()
if Seconds.Value == 5 then
Seconds.Value = 0
end
end)
Seconds.Value = Seconds.Value + 1
end


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
15 Oct 2015 01:43 PM
You don't need to use .Changed if it's checking it every second right?
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
15 Oct 2015 01:45 PM
It doesn't work still.

#code
while true do
wait(1)
Seconds.Value = Seconds.Value + 1
if Seconds.Value == 5 then
Seconds.Value = 0
end
end


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
15 Oct 2015 01:50 PM
Heck, I'm probably doing something wrong here.


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
15 Oct 2015 01:56 PM
while wait(1) do
if Seconds.Value == 5 then
Seconds.Value = 0
end
Seconds.Value = Seconds.Value + 1
end
Report Abuse
hunxrepair is online. hunxrepair
Joined: 07 Aug 2011
Total Posts: 777
15 Oct 2015 01:56 PM
You did not define what seconds is

local Seconds = wherever it is located
Seconds.Changed:connect(function(Val)

if Val > 1 then
print("Bigger than one.")
end

end)


and no, you do not need a loop
changed is already doing that
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
15 Oct 2015 02:03 PM
Uh...
You realize you're connecting an anonymous function over and over for no reason? lol

-=Robo=-
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
15 Oct 2015 02:06 PM
@Hun
Your method didn't seem to work either.


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
15 Oct 2015 02:07 PM
Uh...
You realize you're connecting an anonymous function over and over for no reason? lol[2]

-=Robo=-
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
15 Oct 2015 02:12 PM
Because no one seems to know what I am scripting, here it is.

Player = game:GetService("Players").LocalPlayer
Minutes = nil
Seconds = nil
repeat wait() until Player.Character
for _,Obj in pairs(Player:GetChildren()) do
if Obj:IsA("IntValue") and Obj.Name == "leaderstats" then
coroutine.wrap(function()
for _,Min in pairs(Obj:GetChildren()) do
if Min:IsA("StringValue") and Min.Name == "Minutes" then
Minutes = Min
end
end
for _,Sec in pairs(Obj:GetChildren()) do
if Sec:IsA("StringValue") and Sec.Name == "Seconds" then
Seconds = Sec
end
end
end)()
end
end
coroutine.wrap(function()
while true do
wait(60)
Minutes.Value = Minutes.Value + 1
end
end)()
coroutine.wrap(function()
while true do
wait(1)
Seconds.Changed:connect(function()
if Seconds.Value == 5 then
Seconds.Value = 0
end
end)
Seconds.Value = Seconds.Value + 1
end
end)()


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
15 Oct 2015 02:15 PM
that literally doesn't change what I said at all

-=Robo=-
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
15 Oct 2015 02:21 PM
local function checkValue()
--code
end

StringValue.Changed:connect(checkValue)

while wait(0.1) do
StringValue.Value = StringValue.Value + 1
end



Instance.new("BodyVelocity",SenseiWarrior).velocity = CFrame.new(SenseiWarrior.Torso.Position,YourGirlsDMs.Position).lookVector * 10
Report Abuse
hunxrepair is online. hunxrepair
Joined: 07 Aug 2011
Total Posts: 777
15 Oct 2015 02:23 PM
Are you trying to save their time on the leaderboard?
Insert a local script inside StarterPlayer > StarterPlayerScripts

local Player = game.Players.LocalPlayer


local Seconds = 0
local Minutes = 0
local Hours = 0

while true do
Seconds = Seconds + 1

if Seconds > 59 then
Minutes = Minutes + 1
Seconds = 0
end

if Minutes > 59 then
Hours = Hours + 1
Minutes = 0
end


wait(1)
print(Hours..":"..Minutes..":"..Seconds)
-- and here you access the leaderboard and change its value
end



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