Tinfold
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1435 |
|
|
| 06 Sep 2014 02:42 PM |
When I run the random code in command bar, it works fine.
When I run the script, the words are in the same order every time.
mirror
umbrella
stickman
etc EVERY time.
Help.
_G.CurrentBuild='book' _G.guy=nil _G.msg=nil _G.gotit=false builds={'book','apple','sun','lemon','watermelon','pineapple','ocean','boat','laptop','computer','xbox','pizza','eyeball','alien','dinosaur','roblox','lollipop','ice cream','popsicle','egg','tree','flower','tophat','CD','TV','candle','lemonade stand','knife','sword','pistol','clock','campfire','crossbow','arrow','quarter','couch','chair','lamp','chest','river','road','stop sign','gate','door','stickman','cup','iphone','beach','umbrella','cloud','storm','headphones','mirror','laser','flashlight','window','ninja','burger','sandwich'} generateRandomBuild=function() local bld=builds[math.random(1,#builds)] print(bld) return bld end _G.init=function(p,c) ypcall(function() _G.guy:LoadCharacter() end) _G.guy=p _G.gotit=false local mes=Instance.new('Message',workspace) if c=='start' then mes.Text=p.Name .. ' has been chosen!' elseif c=='win' then mes.Text=p.Name .. ' got it right! ' .. _G.CurrentBuild end p.Character:MoveTo(workspace.TP.Position) wait(2) mes:Destroy() for _,v in pairs(game.ServerStorage.Tools:children()) do v:clone().Parent=p.Backpack end _G.CurrentBuild=generateRandomBuild() local wurd=game.ServerStorage.wurd:clone() wurd.holder.Frame.TextLabel.Text='Your word is: ' .. _G.CurrentBuild wurd.Parent=p.PlayerGui
for i=1,120 do wait(1) if _G.gotit==true then workspace.Clear:ClearAllChildren() break end end if _G.gotit==false then local mes=Instance.new("Message",workspace) workspace.Clear:ClearAllChildren() mes.Text='Nobody has guessed the answer! ' .. _G.CurrentBuild _G.CurrentBuild='book' wait(2) mes:Destroy() wait() _G.init(game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())],'start') end end
game.Players.PlayerAdded:connect(function(plr) wait() plr.Chatted:connect(function(chat) if string.lower(chat)==string.lower(_G.CurrentBuild) then _G.gotit=true _G.init(plr,"win") end end) local num=#game.Players:GetChildren() if num==1 then _G.msg=Instance.new("Message",workspace) _G.msg.Text='2 or more players are needed to start a game!' elseif num>1 and num<3 then ypcall(function() _G.msg:Destroy() _G.msg=nil end) local person=game:service'Players':GetChildren()[math.random(1,2)] _G.init(person,'start') end end)
|
|
|
| Report Abuse |
|
Tinfold
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1435 |
|
| |
| |
Tinfold
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1435 |
|
| |
|
| 06 Sep 2014 02:52 PM |
hey, if you keep being rude:
1. Nobody's gonna answer. 2. You're gonna start a flamewar. |
|
|
| Report Abuse |
|
alaneasy
|
  |
| Joined: 13 Aug 2012 |
| Total Posts: 55 |
|
| |
| |
| |
Tinfold
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1435 |
|
|
| 06 Sep 2014 03:08 PM |
| forum doesnt support indents |
|
|
| Report Abuse |
|