|
| 05 Apr 2012 07:33 AM |
Output: Players.Player.PlayerGui.FactGUI.Script:3: function arguments expected near 'pick'
local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren pick = (math.random(1, #facts))
while true do wait(math.random(1, 5)) frame.Fact.Text = pick.Value print "Picked a fact." frame:TweenPosition(UDim2.new(0, 50, 0, 450) "Out", "Bounce", 2) print "Tweened in the frame." wait(17) frame:TweenPosition(UDim2.new(-1, 0, 0, 450) "Out", Linear", 2) print "Tweened out the frame." wait(2.1) frame.Fact.Text = "" print "Script sucsess!" end |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2012 07:35 AM |
| line 2, misses () after getChildren |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 05 Apr 2012 07:36 AM |
"local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren pick = (math.random(1, #facts))"
Should be
"local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren() pick = (math.random(1, #facts))"
Any method (eg, :Remove(), :FindFirstChild("")) ALWAYS needs to have arguments specified after it. If there aren't any, you just put two brackets. e.g
FindFirstChild("humanoid") -- The argument here is "humanoid" Remove() -- There are no arguments here, but we must still put the brackets.
|
|
|
| Report Abuse |
|
|
|
| 05 Apr 2012 07:41 AM |
Their is another error now :(
Players.Player.PlayerGui.FactGUI.Script:7: attempt to index global 'pick' (a number value) |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
d4rk886
|
  |
| Joined: 17 Nov 2009 |
| Total Posts: 1150 |
|
|
| 05 Apr 2012 08:25 AM |
local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren() pick = (math.random(1, #facts))
while true do wait(math.random(1, 5)) frame.Fact.Text = pick ------------------- pick is a number. print "Picked a fact." frame:TweenPosition(UDim2.new(0, 50, 0, 450) "Out", "Bounce", 2) print "Tweened in the frame." wait(17) frame:TweenPosition(UDim2.new(-1, 0, 0, 450) "Out", Linear", 2) print "Tweened out the frame." wait(2.1) frame.Fact.Text = "" print "Script sucsess!" end |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Apr 2012 10:46 AM |
| frame.Fact.Text = ""..pick.."" |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 05 Apr 2012 10:54 AM |
local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren() pick = facts[(math.random(1, #facts))]
while true do wait(math.random(1, 5)) frame.Fact.Text = pick.Value print "Picked a fact." frame:TweenPosition(UDim2.new(0, 50, 0, 450) "Out", "Bounce", 2) print "Tweened in the frame." wait(17) frame:TweenPosition(UDim2.new(-1, 0, 0, 450) "Out", Linear", 2) print "Tweened out the frame." wait(2.1) frame.Fact.Text = "" print "Script sucsess!" end |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2012 11:09 AM |
local frame = script.Parent.frame local facts = script.Parent.Facts:GetChildren() local pick = (math.random(1, #facts))
while true do wait(math.random(1, 5)) frame.Fact.Text = pick.Value print "Picked a fact." frame:TweenPosition(UDim2.new(0, 50, 0, 450) "Out", "Bounce", 2) print "Tweened in the frame." wait(17) frame:TweenPosition(UDim2.new(-1, 0, 0, 450) "Out", Linear", 2) print "Tweened out the frame." wait(2.1) frame.Fact.Text = "" print "Script sucsess!" end |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2012 04:32 PM |
| Well, I want the script so that it randomly picks a child from something and it gets the string value and put the string value in a gui. Can someone modify the script so it does that please. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
| |
|
|
| 06 Apr 2012 09:50 AM |
| Try the tostring() function (And yes, that too needs brackets lol) |
|
|
| Report Abuse |
|
|