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 » Scripting Helpers
Home Search
 

Re: What's wrong with this?

Previous Thread :: Next Thread 
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 04:21 PM
BUMP
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Jan 2013 04:22 PM
LOL WUT
Report Abuse
noah is not online. 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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 04:54 PM
Can I get help Noah?
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 05:39 PM
bump
Report Abuse
noah is not online. 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 is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
03 Jan 2013 05:43 PM
@noah read my mind.
Report Abuse
noah is not online. 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 is not online. 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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 06:22 PM
bump
Report Abuse
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 06:27 PM
Noah? Anyone???
Report Abuse
TheWhiteAngle is not online. TheWhiteAngle
Joined: 31 Dec 2011
Total Posts: 435
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
MantarayJack is not online. MantarayJack
Joined: 22 Dec 2012
Total Posts: 183
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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
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 is not online. 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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 07:00 PM
I tested them and they did nothing...
Report Abuse
MantarayJack is not online. MantarayJack
Joined: 22 Dec 2012
Total Posts: 183
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
theuntimelydoctor is not online. theuntimelydoctor
Joined: 30 Jun 2011
Total Posts: 718
03 Jan 2013 07:07 PM
Thanks! If only I could tell how it worked.
Report Abuse
MantarayJack is not online. MantarayJack
Joined: 22 Dec 2012
Total Posts: 183
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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