|
| 03 Jan 2013 04:10 PM |
When I say giraffe absolutely nothing happens. I think I may have misplaced an end. What's wrong?
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "giraffe" then for i,v in pairs(game:service'Players':GetPlayers())do end end end) end) pcall(function() for i,a in pairs(Workspace.Giraffe1:GetChildren() )do end end) pcall(function() for i,b in pairs(Workspace.Giraffe2:GetChildren() )do end end) pcall(function() for i,c in pairs(Workspace.Giraffe3:GetChildren() )do end end) pcall(function() for i,d in pairs(Workspace.Giraffe4:GetChildren() )do end end) pcall(function() for i,e in pairs(Workspace.Giraffe5:GetChildren() )do end end) pcall(function() for i,f in pairs(Workspace.Giraffe6:GetChildren() )do end end) pcall(function() for i,g in pairs(Workspace.Giraffe7:GetChildren() )do end end) pcall(function() for i,h in pairs(Workspace.Giraffe8:GetChildren() )do end end) pcall(function() a.Transparency = 1 b.Transparency = 0 end) wait (1) pcall(function() b.Transparency = 1 c.Transparency = 0 end) wait (1) pcall(function() c.Transparency = 1 d.Transparency = 0 end) wait (1) pcall(function() d.Transparency = 1 e.Transparency = 0 end) wait (1) pcall(function() e.Transparency = 1 f.Transparency = 0 end) wait (1) pcall(function() f.Transparency = 1 g.Transparency = 0 end) wait (1) pcall(function() g.Transparency = 1 h.Transparency = 0 end) wait (1) pcall(function() h.Transparency = 1 a.Transparency = 0 end) |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 03 Jan 2013 04:23 PM |
| oh my god... dis should be in the top ten inefficent roblox scripts |
|
|
| Report Abuse |
|
|
| |
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 03 Jan 2013 05:41 PM |
| ok, wut exactly r u trying to do? |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 03 Jan 2013 05:49 PM |
lolwut. ok so dis is what i got without u telling me wut it does -_-
try dis
models = {"Giraffe1", "Giraffe2", "Giraffe3", "Giraffe4", "Giraffe5", "Giraffe6", "Giraffe7", "Giraffe8"} game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "giraffe" then for i,models in pairs (models) do for i,v in pairs (game.Workspace:GetChildren()) do if v.Name == models then v.Transparency = 1 wait(2) v.Transparency = 0 end end end end end) end) |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 03 Jan 2013 05:55 PM |
owait, i messed up. use dis instead
models = {"Giraffe1", "Giraffe2", "Giraffe3", "Giraffe4", "Giraffe5", "Giraffe6", "Giraffe7", "Giraffe8"} game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "giraffe" then for i,stuff in pairs (models) do for i,v in pairs (game.Workspace:GetChildren()) do if v.Name == stuff then v.Transparency = 1 wait(2) v.Transparency = 0 end end end end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 06:01 PM |
| Basically I have a giraffes lined up to make a square (called giraffe 1-8 in order) I'm trying to make it so when you say giraffe it makes it look as if one giraffe is moving in a circle. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 06:12 PM |
@noah your script was doing nothing so I changed the script to the following to test it the output just said there was a problem with the line that said "v.Transparency = 1"
models = {"Giraffe1", "Giraffe2", "Giraffe3", "Giraffe4", "Giraffe5", "Giraffe6", "Giraffe7", "Giraffe8"} --game.Players.PlayerAdded:connect(function(player) --player.Chatted:connect(function(msg) --if msg == "giraffe" then for i,stuff in pairs (models) do for i,v in pairs (game.Workspace:GetChildren()) do if v.Name == stuff then v.Transparency = 1 wait(2) v.Transparency = 0 end end end --end --end) --end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 03 Jan 2013 06:31 PM |
-_-'
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg:lower() == "giraffe" then for i,v in pairs (workspace:GetChildren()) do if string.find(msg,v.Name) then v.Transparency = 1 wait(2) v.Transparency = 0 end end end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 06:33 PM |
local modelNames = {} for i = 1, 8 do table.insert(modelNames, "Giraffe" .. i) end
local function cycle() local models = {} for i = 1, #modelNames do table.insert(models, workspace:FindFirstChild(modelName[i])) end if #models > 1 then local A = model[1] for i = 2, #A do B = model[i] for _, child in ipairs(A) do if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B) do if child:IsA("BasePart") then child.Transparency = 0 end end wait(1) A = B end local B = model[1] for _, child in ipairs(A) do if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B) do if child:IsA("BasePart") then child.Transparency = 0 end end end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "giraffe" then Spawn(cycle) end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 06:51 PM |
They don't work. I think I might be miscommunicating this is the 8 giraffes in a model (7 are already invisible)
http://www.roblox.com/The-giraffes-item?id=102643773 |
|
|
| Report Abuse |
|
|
ninja5566
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 5233 |
|
|
| 03 Jan 2013 06:57 PM |
All of these do works, very inefficient but will work
p.s have fun with lag. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 07:00 PM |
| I tested them and they did nothing... |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 07:02 PM |
Fixed.
local modelNames = {} for i = 1, 8 do table.insert(modelNames, "Giraffe" .. i) end
local function cycle() local models = {} for i = 1, #modelNames do table.insert(models, workspace:FindFirstChild(modelNames[i])) end if #models > 1 then local A = models[1] for i = 2, #models do B = models[i] for _, child in ipairs(A:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 0 end end wait(1) A = B end local B = models[1] for _, child in ipairs(A:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 0 end end end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "giraffe" then Spawn(cycle) end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 07:07 PM |
| Thanks! If only I could tell how it worked. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 07:15 PM |
local modelNames = {} -- the names of the models will go here for i = 1, 8 do -- place names of the form GiraffeX in modelNames table.insert(modelNames, "Giraffe" .. i) end
local function cycle() local models = {} -- the model objects will go here for i = 1, #modelNames do -- find each model by name table.insert(models, workspace:FindFirstChild(modelNames[i])) end if #models > 1 then -- we need at least 2 models to cycle between local A = models[1] -- A is the last model we processed for i = 2, #models do B = models[i] -- B is the one we are currently processing for _, child in ipairs(A:GetChildren()) do -- make all parts in the previous model invisible if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B:GetChildren()) do -- make all parts in the current model visible if child:IsA("BasePart") then child.Transparency = 0 end end wait(1) A = B -- for the next iteration, B will be the previous model end local B = models[1] -- process the first and last models to get back to our original state for _, child in ipairs(A:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 1 end end for _, child in ipairs(B:GetChildren()) do if child:IsA("BasePart") then child.Transparency = 0 end end end end
game.Players.PlayerAdded:connect(function(player) -- fires when a player joins player.Chatted:connect(function(msg) -- fires when said player chats if msg == "giraffe" then -- if the player chats 'giraffe' Spawn(cycle) -- execute the function 'cycle' in a new thread to avoid errors in this thread end end) end) |
|
|
| Report Abuse |
|
|