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 » Scripters
Home Search
 

Re: ##: How do I use Get Player from Character?

Previous Thread :: Next Thread 
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:07 PM
Help ;-; I need it for something in game, the rest is working, but this doesn't.
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:08 PM
1
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:14 PM
2
Report Abuse
BlastAccost is not online. BlastAccost
Joined: 26 Mar 2013
Total Posts: 9642
27 Jun 2015 11:19 PM
player.CharacterAdded:wait()
player.Character



--Check if this works
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:20 PM
3
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
27 Jun 2015 11:21 PM
game:GetService("Players"):GetPlayerFromCharacter(character)

more here:
http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter

while true do the do
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:21 PM
Im not too sure if that would work because the script is going to detect a value in someone backpack when they click a Part. :/
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:25 PM
Ah, thanks, but, it now said: Unknown global 'character'
Report Abuse
BlastAccost is not online. BlastAccost
Joined: 26 Mar 2013
Total Posts: 9642
27 Jun 2015 11:25 PM
A script that will check if the player has a specific tool in his/her backpack?
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
27 Jun 2015 11:26 PM
@OP you will have to pass in the character of course..


while true do the do
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:31 PM
Oh, I said that wrong, it was to detect the value on the Player under Players! Sorry about that.
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:35 PM
Bump
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
27 Jun 2015 11:40 PM
Bump 1
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
27 Jun 2015 11:44 PM
Sorry, switched to my alt. Here's the script:

script.Parent.ClickDetector.MouseClick:connect(function(x)

game.Players.LocalPlayer.Geodes.Value = game.Players.LocalPlayer.Money.Value + 1
script.Parent:Destroy()
print('bleh')

end)

The goal is for it to read the amount after the player clicks a brick and add to the value.
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
27 Jun 2015 11:46 PM
Whoops, don't know where the word geodis came from, it's supposed to say Money lol
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
27 Jun 2015 11:49 PM
Buh~Bump
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
27 Jun 2015 11:50 PM
Buhh~Bump
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
27 Jun 2015 11:51 PM
There's 2 problems that I am currently aware of with the code:

1 is that Local Scripts will not work with a Part.

2 is that LocalPlayer will not work without a LocalScript.


How do I overcome this?
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
27 Jun 2015 11:53 PM
1. Dont use a local script for this, mouse click event returns the player that fired the event, in this case inside the brackets

script.Parent.ClickDetector.MouseClick:connect(function(player)
local Geodes= player:FindFirstChild("Geodes") --finding "Geodes" inside the player who clicked it
Geodes.Value = tonumber(Geodes.Value) + 1 --Adding 1 to Goedes' value
script.Parent:Destroy() --Destroy
print'bleh'

end)

while true do the do
Report Abuse
BlastAccost is not online. BlastAccost
Joined: 26 Mar 2013
Total Posts: 9642
27 Jun 2015 11:56 PM
I still don't get your goal here...
Report Abuse
iCherryBearypmACC is not online. iCherryBearypmACC
Joined: 14 Feb 2015
Total Posts: 43
28 Jun 2015 12:01 AM
It worked, Oh my goodness, thank you so much! How does this part work though?

tonumber(Geodes.Value) + 1
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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