of     2   
chevron_rightchevron_rightchevron_right

Jackd44
#95387422Saturday, April 20, 2013 11:24 AM GMT

So basically I'm trying to make it so a player has been chosen and their name is stored inside a variable named "NextIt"(Don't worry, I have set a path, it knows what NextIt is and where it is.) And soon through my script I get this error:Unable to cast value to Object Script "Workspace.HideAndSeek", Line 130 - global Choose_It Ok, so I gathered that it was around line 130, so I take a look there. 130-it = game.Players:playerFromCharacter(NextIt.Value) 131-m.Text = it.Name.." has been chosen! Because they bought the V.I.P room bonus!" Now after lots of testing and messing around I couldn't understand what was going wrong. Does anyone know the answer?
Jackd44
#95388658Saturday, April 20, 2013 11:58 AM GMT

*Shame* Bump.
DataStore
#95389105Saturday, April 20, 2013 12:10 PM GMT

'NextIt' -> You've not told us it's 'ClassName'. Is it an ObjectValue, or..?
Jackd44
#95389684Saturday, April 20, 2013 12:23 PM GMT

Ah yes sorry, NextIt is a string value :) It has already been defined earlier in the script.
DataStore
#95392132Saturday, April 20, 2013 1:06 PM GMT

The ':GetPlayerFromCharacter()' does not 'accept' a string value as an argument within the method. You have to give it a character object. For example, local Thing = game.Players:GetPlayerFromCharacter(Workspace.Player1)
Jackd44
#95392939Saturday, April 20, 2013 1:17 PM GMT

Yeah, that was part of my playing around, I just have no idea how to use something similar to it with strings. :/
DataStore
#95394555Saturday, April 20, 2013 1:38 PM GMT

game.Players:playerFromCharacter(game.Players[NextIt.Value]) ..?
Jackd44
#95395867Saturday, April 20, 2013 1:55 PM GMT

It's getting somewhere after using a bit of what you have posted it seemed to get past that line, then it gets on to the next line and crashes, I'm going to try and solve this one too, but help would be great :) Here is the next line: m.Text = it.Name.." has been chosen! Because they bought the V.I.P room bonus!" and here is the error: Workspace.HideAndSeek:131: attempt to index upvalue 'it' (a nil value) So like I said, I'll have a go at this one aswell(Like the other problems I've attempted) but help would be good. :)
Jackd44
#95395981Saturday, April 20, 2013 1:57 PM GMT

Oh and yeah, that code is line 131 :)
Notunknown99
#95396170Saturday, April 20, 2013 1:59 PM GMT

replace the GetPlayerFromCharacter bit with game.Players[NextIt.Name]
Jackd44
#95397295Saturday, April 20, 2013 2:16 PM GMT

Ok, did that now I'm getting ItNext is not a valid member of Players Strange...
YeahNick
#95397532Saturday, April 20, 2013 2:19 PM GMT

if game.Players:FindFirstChild(NextIt.Value) then print("OMG CART MUST BE A GENIUS") end
Jackd44
#95399251Saturday, April 20, 2013 2:40 PM GMT

It's a good thing I don't just copy what people post... I read it! Muhahahaha :P
Notunknown99
#95401760Saturday, April 20, 2013 3:11 PM GMT

Sorry, I meant value :P
Shedletsky60
#95402220Saturday, April 20, 2013 3:16 PM GMT

Lol
Jackd44
#95445736Saturday, April 20, 2013 10:29 PM GMT

Changed to value, now it says "String expected" on the same line of it = game.Players[NextIt.Value]
Notunknown99
#95446000Saturday, April 20, 2013 10:32 PM GMT

Is NextIt a StringValue?
Jackd44
#95446105Saturday, April 20, 2013 10:33 PM GMT

Yes.
Notunknown99
#95446288Saturday, April 20, 2013 10:35 PM GMT

Are you sure its value is not ""?
Jackd44
#95446622Saturday, April 20, 2013 10:39 PM GMT

Yes, I have a print line which prints the NextIt's name. However my roblox studio has a bug where I can't actually see values myself, put I can print it. That COULD be the cause.
Jackd44
#95446680Saturday, April 20, 2013 10:39 PM GMT

*but
Notunknown99
#95446912Saturday, April 20, 2013 10:42 PM GMT

have you checked spelling?
Jackd44
#95447848Saturday, April 20, 2013 10:52 PM GMT

Ok, so I can show the value is there because this is 2 lines of the output: Successful! Now Player1 will be it next game! And here is the code inside the "String setting" brick: 6-local Buyer = game.Players:playerFromCharacter(hit.Parent) 7-local NextIt = game.Workspace.ItNext 23-Buyer.leaderstats.Points.Value = Buyer.leaderstats.Points.Value - 30 24-NextIt.Value = Buyer.Character.Name 25-print("Successful!") 26-print("Now "..NextIt.Value.." will be it next game!") So the value exists... But now I'm getting this error: NextIt.Value is not a valid member of Players Script "Workspace.HideAndSeek", Line 130 - global Choose_It So it's at line 130. Here's the script near there: 129-if NextIt.Value ~= nil then 130-it = game.Players["NextIt.Value"] 131-m.Text = it.Name.." has been chosen! Because they bought the V.I.P room bonus!" I have no idea what's going on. Please help! :/
Jackd44
#95448011Saturday, April 20, 2013 10:54 PM GMT

Oh and aswell. The ["NextIt.Value"] with the speech marks don't matter, it's the same error with and without them.
Jackd44
#95449945Saturday, April 20, 2013 11:14 PM GMT

Have I confused everyone? :P

    of     2   
chevron_rightchevron_rightchevron_right