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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 20 Feb 2010 |
| Total Posts: 1625 |
|
|
| 20 Jul 2011 06:54 PM |
| ROBLOX gon' mad this week? |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 09 May 2009 |
| Total Posts: 16523 |
|
|
| 21 Jul 2011 05:26 PM |
| Bump. I still can't get it working. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2011 05:39 PM |
| You DO need "". Its a string value. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 22 Jul 2011 11:46 AM |
@Mario
You don't need a capital W for workspace.
-My hand is a dolphin |
|
|
| Report Abuse |
|
|