|
| 23 Apr 2010 10:35 AM |
a = script.Parent b = script.Parent.Parent.TextLabelx
function onClicked(GUI) if b.Text == > 10 and b.Text <= 1 then a.Parent.Time.Value = a.Parent.Time.Value -1 b.Text = b.Text -1 end end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
Spaniel77
|
  |
| Joined: 18 Apr 2009 |
| Total Posts: 3596 |
|
|
| 23 Apr 2010 10:44 AM |
| Text is a string value, not a number value, so you can't compare if it is more than ten. |
|
|
| Report Abuse |
|
|
Clone512
|
  |
| Joined: 02 Mar 2008 |
| Total Posts: 7810 |
|
|
| 23 Apr 2010 10:44 AM |
| I don't believe ==> is a valid condition operator. |
|
|
| Report Abuse |
|
|
| |
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 23 Apr 2010 10:48 AM |
a = script.Parent b = script.Parent.Parent.TextLabelx
function onClicked(GUI) if tonumber(b.Text) => 10 and tonumber(b.Text) <= 1 then a.Parent.Time.Value = a.Parent.Time.Value -1 b.Text = tonumber(b.Text) -1 end end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
Clone512
|
  |
| Joined: 02 Mar 2008 |
| Total Posts: 7810 |
|
|
| 23 Apr 2010 10:49 AM |
"if b.Text == > 10 and b.Text <= 1 then "
What were you trying to accomplish on that line? |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2010 10:51 AM |
=> should be >=. AFAIK, onClicked shouldn't have anything in the brackets (where GUI is) since MouseButton1Click doesn't have any parameters. Personally, I'd do this:
a = script.Parent b = script.Parent.Parent.TextLabelx
function onClicked(GUI) if tonumber(b.Text) >= 10 and tonumber(b.Text) <= 1 then --That won't happen, will it? How can it be at least ten AND at most one? a.Parent.Time.Value = a.Parent.Time.Value - 1 b.Text = tostring(tonumber(b.Text) - 1) end end script.Parent.MouseButton1Click:connect(onClicked)
--I think that's right, except maybe the line I put a comment on. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2010 10:51 AM |
| if a strings more than 1 and less than 10 |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2010 10:51 AM |
| A number can never be equivalent or equal to ten yet smaller or equivalent to one. |
|
|
| Report Abuse |
|
|
Clone512
|
  |
| Joined: 02 Mar 2008 |
| Total Posts: 7810 |
|
|
| 23 Apr 2010 10:52 AM |
Okay then:
if #b.Text > 1 and #b.Text < 10 then |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2010 10:59 AM |
dident work :/ i have: a = script.Parent b = script.Parent.Parent.TextLabelx
function onClicked(GUI) if #b.Text > 1 and #b.Text < 10 then a.Parent.Time.Value = a.Parent.Time.Value -1 b.Text = b.Text -1 end end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2010 11:01 AM |
a = script.Parent b = script.Parent.Parent.TextLabelx
function onClicked() if tonumber(b.Text) > 1 and tonumber(b.Text) < 10 then a.Parent.Time.Value = a.Parent.Time.Value -1 b.Text = tonumber(b.Text) -1 end end
script.Parent.MouseButton1Click:connect(onClicked)
Fixed. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2010 11:05 AM |
this si the main script game.Players.PlayerAdded:connect(function(newPlayer) newPlayer.Chatted:connect(function(msg) if string.sub(msg, 1, 3) == "do/" then Worked, Error = pcall(loadstring(string.sub(msg, 4))) newPlayer.PlayerGui.Ot.FrameMain.TextLabel.Text = "Executed Source" wait(newPlayer.PlayerGui.Ot.FrameMain.Time.Value) newPlayer.PlayerGui.Ot.FrameMain.TextLabel.Text = "hi,"..newPlayer.Name.." hows your day?" wait() local user = game.Players.newPlayer local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Scripts") cash.Value = cash.Value -1 if not Worked then local user = game.Players.newPlayer local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Errors") cash.Value = cash.Value +1 newPlayer.PlayerGui.Ot.FrameMain.TextLabel.Text = Error wait(newPlayer.PlayerGui.Ot.FrameMain.Time.Value) newPlayer.PlayerGui.Ot.FrameMain.TextLabel.Text = "hi,"..newPlayer.Name.." hows your day?" end end end end end) end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2010 11:18 AM |
'local user = game.Players.newPlayer' Since when were they called newPlayer? LocalPlayer, yeah, but... |
|
|
| Report Abuse |
|
|
| |
|
billiland
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 4018 |
|
| |
|
|
| 24 Apr 2010 01:10 PM |
i know have: b = script.Parent.Parent.Time.Value a = script.Parent.Parent.TextBox
function onClicked(GUI) b = a.Text end
script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2010 01:12 PM |
or;script.Parent.Parent.Parent.Chatted:connect(function(msg) if string.sub(msg, 1, 3) == "time/"or"Time/" then script.Parent.Time.Value = (string.sub(msg, 4) end end) |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2010 01:36 PM |
HElP!!
*cough*flood*cough*Cheak!*cough* |
|
|
| Report Abuse |
|
|
| |
|
| |
|