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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: Help fix this script please.

Previous Thread :: Next Thread 
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 05:52 PM
b
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 05:55 PM
the script is supposed to give you an arrowhead if you walk over one.
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 05:57 PM
didntwork
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:04 PM
still didnt work, no output
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
09 Apr 2015 06:06 PM
That works fine, is it inside the brick, and is it in a serverscript?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:06 PM
it was in a localscript
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:07 PM
it sends the arrowhead to lighting now, but doesn't increase the value.
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:09 PM
Nvm I have to move the value named numarrowheads to character.
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:14 PM
the model of a player and playergui are in different objects
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:16 PM
THAT WAS YOUR MISTAKE.
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 06:30 PM
someone else help
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 07:07 PM
it's fixed now but im having a problem regenerating the arrowhead
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 07:11 PM
the problem is the arrowhead will have many duplicates
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
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
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 07:18 PM
i cant do what you said if there are duplicates
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
09 Apr 2015 07:20 PM
nvm I fixed it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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