|
| 09 Apr 2015 05:47 PM |
player = game.Players.LocalPlayer script.Parent.Touched:connect(function() player.PlayerGui.numarrowheads.Value = player.PlayerGui.numarrowheads.Value + 1 script.Parent.Parent = game.Lighting end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Apr 2015 05:55 PM |
| the script is supposed to give you an arrowhead if you walk over one. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 05:55 PM |
script.Parent.Touched:connect(function(hit) player = game.Players[hit.Parent.Name] player.PlayerGui.numarrowheads.Value = player.PlayerGui.numarrowheads.Value + 1 script.Parent.Parent = game.Lighting end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Apr 2015 06:00 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.numarrowheads.Value = player.PlayerGui.numarrowheads.Value + 1 script.Parent.Parent = game.Lighting end end) |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 06:04 PM |
| still didnt work, no output |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 06:06 PM |
| That works fine, is it inside the brick, and is it in a serverscript? |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Apr 2015 06:07 PM |
| it sends the arrowhead to lighting now, but doesn't increase the value. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 06:08 PM |
You can only use LocalScripts if it's isnide the player.
e.g.
Backpack PlayerGui Their Model. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 06:09 PM |
| Nvm I have to move the value named numarrowheads to character. |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 06:14 PM |
| the model of a player and playergui are in different objects |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 09 Apr 2015 06:43 PM |
Put in a regular server script in the same part
Also, I changed the location of the thing from Lighting to Replicated Storage. Do not use lighting for storing things, instead use Replicated Storage, which is the upgraded version of lighting. You can also put it in Server Storage, where it is completely safe from hackers, but this will mean it can only be accessed in server scripts.
script.Parent.Tocuhed:connect(function(hit) local player=game.Players:GetPlayerFromCharacter(hit.Parent) if player then local object=player.PlayerGui:FindFiestChild("numarrowheads") if object then object.Value=object.Value+1 script.Parent.Parent=game.ReplicatedStorage end end end)
|
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 07:07 PM |
| it's fixed now but im having a problem regenerating the arrowhead |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 07:08 PM |
Since we put it in ReplicatedStorage, not lighting (which is the replacement for lighting, far better), you'll have to take it out from there
Example: if before it was game.Lighting.NameOfObject.Parent=workspace
change game.Lighting to game.ReplicatedStorage
game.ReplicatedStorage.NameOfObject.Parent=workspace |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 07:11 PM |
| the problem is the arrowhead will have many duplicates |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 07:13 PM |
Just change it all to ReplicatedStorage.
Trust me, you do NOT want to be using lighting for storage anymore |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 07:18 PM |
| i cant do what you said if there are duplicates |
|
|
| Report Abuse |
|
|
| |
|