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 did I do wrong? :S

Previous Thread :: Next Thread 
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
20 Jul 2011 06:43 PM
It's an idle script. It's my first time attempting something like this, so I'm sure there's a lot wrong with it. But I'm only asking for help with one thing at a time.

Script:
------------------------------------------------------
Derp = Instance.new("Model")
Derp.Parent = game.workspace
Derp.Name = Peoples

function onPlayerEntered(player)
wait(.1)
wat = Instance.new("Vector3Value")
wat.Name = player.Name
wat.Parent = Derp
end

while true do
wait()
x = game.Players:GetChildren()
y = Derp:GetChildren()
if x.Name == y.Name then
y.Value = x.Character.Position
wait(5)
if y.Value == x.Character.Position then
x.Character:Remove()
end
end
end
-----------------------------------------
All it does is create a Model named "Model" in workspace.

All it says in Output is "String expected"
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
20 Jul 2011 06:44 PM
Where does it say it's expected? That's important.
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
20 Jul 2011 06:51 PM
It doesn't, unfortunately. The Output can be rediculously vague sometimes.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
20 Jul 2011 06:51 PM
I hate that. My script broke, and der'z no output. D:
Report Abuse
wuppii is not online. wuppii
Joined: 20 Feb 2010
Total Posts: 1625
20 Jul 2011 06:54 PM
ROBLOX gon' mad this week?
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
20 Jul 2011 07:00 PM
Yarlly.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
20 Jul 2011 07:01 PM
Derp = Instance.new("Model")
Derp.Parent = game.workspace
Derp.Name = "Peoples"

function onPlayerEntered(player)
wait(2)
wat = Instance.new("Vector3Value")
wat.Name = player.Name
wat.Parent = Derp
end

while true do
wait()
x = game.Players:GetChildren()
y = Derp:GetChildren()
if x.Name == y.Name then
y.Value = x.Character.Position
wait(5)
if y.Value == x.Character.Position then
x.Character:Remove()
end
end
end
Report Abuse
Kevaknight is not online. Kevaknight
Joined: 08 Jun 2009
Total Posts: 2278
20 Jul 2011 07:03 PM
I'm not sure, but when I tried a script like this someone told me I was getting the players as if they were an object value, try using insert service.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
20 Jul 2011 07:05 PM
The problem was this only:

Derp.Name = Peoples
Suposed to be:
Derp.Name = "Peoples"

And

wait(.1) --not enough
Put to
wait(2) --enough :3
Report Abuse
setro2 is not online. setro2
Joined: 16 Apr 2010
Total Posts: 1571
20 Jul 2011 07:49 PM
You need to add something to add a part. If that isn't what your looking for, then idk.
Report Abuse
Mario5422 is not online. Mario5422
Joined: 17 Nov 2008
Total Posts: 3922
20 Jul 2011 07:51 PM
Derp.Parent = Workspace -- You don't need game in front of it, and also you have to capitalize Workspace.
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
20 Jul 2011 07:54 PM
Derp = Instance.new("Model")
Derp.Parent = game.workspace
Derp.Name = Peoples

function onPlayerEntered(player)
wait(.1)
wat = Instance.new("Vector3Value")
wat.Name = player.Name
wat.Parent = Derp
end

while true do
wait()
x = game.Players:GetChildren()
y = Derp:GetChildren()
if x.Name == y.Name then
y.Value = x.Character.Position
wait(5)
if y.Value == x.Character.Position then
x.Character:Remove()
end
end
end

You can't access the 'Name' property of a table.

if x = game.Players:GetChildren() you can't say x.Name.

The same goes for y.
Report Abuse
setro2 is not online. setro2
Joined: 16 Apr 2010
Total Posts: 1571
20 Jul 2011 08:05 PM
wait(0.1)
game.Workspace.mbest.Head:remove()-- BANG! GOTCHA!
end
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
21 Jul 2011 01:04 AM
Thanks for all who tried, but Doom is really the only one who's helped so far.

@Crni,
Neither one of those are required. :/
The "" is only needed if there are spaces or special symbols in the name.
And a wait is a wait, no amount of time will change that.

@Mario,
That doesn't help. It can be either way, and it still doesn't fix the script itself.

@Setro,
Just leave...

@Doom,
I'm new to the GetChildren function. Could someone please explain how to use it correctly then?
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
21 Jul 2011 05:26 PM
Bump. I still can't get it working.
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
21 Jul 2011 05:39 PM
You DO need "". Its a string value.
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
21 Jul 2011 05:41 PM
It's not a string value, it's a tag.
And it doesn't matter, because the quotes didn't fix it anyways.
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
21 Jul 2011 10:02 PM
String expected means you dont have a string where there needs to be:

Derp.Name = "Peoples"



Keep it as a string.
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
21 Jul 2011 10:20 PM
It doesn't say where the string is needed. Besides, even with your string, the output still says "String Expected"
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
22 Jul 2011 11:29 AM
Derp = Instance.new("Model")
Derp.Parent = workspace
Derp.Name = "Peoples"

function onPlayerEntered(player)
wait(.1)
wat = Instance.new("Vector3Value")
wat.Name = player.Name
wat.Parent = Derp
end

while true do
wait()
x = game.Players:GetChildren()
y = Derp:GetChildren()
for i = 1,#x do
for m = 1,#y do
if a[i].Name == y[m].Name then
y.Value = Vector3.new(x.Character["Left Leg"].Position.X, x.Character["Left Leg"].Position.Y, x.Character["Left Leg"].Position.Z)
wait(5)
if y[m].Value == Vector3.new(x.Character["Left Leg"].Position.X, x.Character["Left Leg"].Position.Y, x.Character["Left Leg"].Position.Z) then
x.Character:Remove()
end
end
end
end
end


game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
mbest is not online. mbest
Joined: 09 May 2009
Total Posts: 16523
22 Jul 2011 11:40 AM
That does mane more sense than what I have. Apologies about ealier, from my point of view, you didn't seem to know what you were talking about. But clearly you do.

But now I'm not sure whether we've taken a step back, or we just havn't made progress at all.
There's a new problem:
It creates the Model, and names it approriately, but it doesn't create an instance of the value to put in the model. And now nothing shows up in Output also.
Report Abuse
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
22 Jul 2011 11:46 AM
@Mario

You don't need a capital W for workspace.

-My hand is a dolphin
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