|
| 27 Jun 2015 11:07 PM |
| Help ;-; I need it for something in game, the rest is working, but this doesn't. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 Jun 2015 11:19 PM |
player.CharacterAdded:wait() player.Character
--Check if this works |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 27 Jun 2015 11:25 PM |
| Ah, thanks, but, it now said: Unknown global 'character' |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 27 Jun 2015 11:56 PM |
| I still don't get your goal here... |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|