Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 07 Jun 2017 11:34 PM |
this is a server script, i'm not sure why it's not working. Anyone know?
local blob = script.Parent local player = game.Players:FindFirstChild(script.User.Value)
player.BlobStats.Color.changed:connect(function(newcolor) blob.BrickColor = BrickColor.new(newcolor) end) |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2017 11:37 PM |
Is User a StringValue?
Also it's Changed not changed.
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
| |
|
|
| 07 Jun 2017 11:40 PM |
Can you print out the value of User before you initialize player? Just so you can see what it's set to.
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 07 Jun 2017 11:42 PM |
I checked, it was player1
Do you know any other ways of find a local player using a server script? |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2017 11:43 PM |
Not possible, local players can only be accessed via local scripts.
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 07 Jun 2017 11:47 PM |
| I mean all I need to do is find the players name in Players using a server script |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2017 11:48 PM |
Yes that's it
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 07 Jun 2017 11:56 PM |
i figured it out, I just needed to add a wait(1)
anyway, can you help with my next issue?
error: bad argument #1 to 'new' (Color3 expected, got BrickColor)
Color is a BrickColorValue inside a folder called BlobStats
player.BlobStats.Color.Changed:connect(function(newcolor) blob.BrickColor = BrickColor.new(newcolor) end) |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2017 11:58 PM |
Print out the new color variable. See if it prints out a name or a color3. It should print out a name or something. Tell me what it prints.
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:01 AM |
| Prints out the color name (Black, Earth green, etc) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:03 AM |
And you're sure that the parent of the script is a BasePart? (Part, UnionOperation, MeshPart)?
Try doing this instead, not sure if it will have any effect:
blob.Color = BrickColor.new(newcolor).Color
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:07 AM |
It is.
And that had the same outcome |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:13 AM |
Oh wait... What class is BlobStats? You might need to rename the "Color" thing something else because Color is a property that takes Color3s. Rename it to Col or something and see if that works
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:21 AM |
That didn't work. I got the same error.
But what's weird is that I changed it to:
player.BlobStats.BlobColor.Changed:connect(function(newcolor) print(newcolor) blob.BrickColor = Color3.new(newcolor) end)
And got this error:
bad argument #3 to 'BrickColor' (BrickColor expected, got Color3)
Previous Error:
bad argument #1 to 'new' (Color3 expected, got BrickColor) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:24 AM |
Well it technically did work, you just changed it from BrickColor.new(newcolor) to Color3.new(newcolor)
So just change it back to BrickColor and you should be good :^)
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:28 AM |
then I still get this error
bad argument #1 to 'new' (Color3 expected, got BrickColor) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:30 AM |
Send the full script that gives you that error again
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:32 AM |
wait(1) local blob = script.Parent local player = game.Players:FindFirstChild(script.User.Value)
player.BlobStats.BlobColor.Changed:connect(function(newcolor) print(newcolor) blob.BrickColor = BrickColor.new(newcolor) end) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:35 AM |
- Change game.Players:FindFirstChild to game.Players:WaitForChild - Add print(blob.ClassName) after you define player
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 12:57 AM |
print out "Part"
error:
bad argument #1 to 'new' (Color3 expected, got BrickColor) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 12:58 AM |
That's really odd... I can't think of anything else that could be wrong here...
discord.gg/fissygames |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 01:02 AM |
Is BlobColor a BrickColor value or a StringValue?
|
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 08 Jun 2017 01:05 AM |
| BlobColor is a BrickColorValue |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 01:07 AM |
wait(1) local blob = script.Parent local player = game.Players:FindFirstChild(script.User.Value)
player.BlobStats.BlobColor.Changed:connect(function(newcolor) print(newcolor) blob.BrickColor = player.BlobStats.BlobColor.Value end)
|
|
|
| Report Abuse |
|
|