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: Anyone know why this script is breaking

Previous Thread :: Next Thread 
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
05 Aug 2015 11:34 PM
local Part = script.Parent
local Leaderboard = Instance.new("IntValue")
local Score = Instance.new("IntValue")
function onEnter(Player)
Leaderboard.Name = "leaderstats"
Score.Name = "Score"
Score.Value = 0
Leaderboard.Parent = Player
Score.Value = Leaderboard
end




function onTouch(Brick)
local Player = Brick.Parent:findFirstChild("Humanoid")
if (Player ~= nil)then
local Location = game:GetService('Players'):GetPlayerFromCharacter(Player.Parent)
Scores.Value = Scores.Value + 1

end
end


It gives me an error on the Scores.Value = Scores.Value + 1 line

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
Acrobatically is not online. Acrobatically
Joined: 02 Apr 2015
Total Posts: 2769
05 Aug 2015 11:40 PM
have two different scripts.. one in workspace, one in brick
-- try this leaderboard;


function onPlayerEntered(newPlayer)

local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

local mins = Instance.new("IntValue")
mins.Name = "Credits" -- Whatever your currency is called
mins.Value = 0


mins.Parent = stats

stats.Parent = newPlayer

while true do
wait(121) -- How long it takes you to get (x) money
mins.Value = mins.Value + 100 --- How much money you want over (x) time
end
end


game.Players.ChildAdded:connect(onPlayerEntered)

-- Acrobatically

-----

What's the error say?



"I'm going to become a employee at mcdonalds for my career :)" - ISOLAYTOR/YShaarj
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
05 Aug 2015 11:48 PM
error is

Frame
0

What
Lua

FunctionName
onTouch

Line No
19

Source
Workspace.Part.Script

Function Explanation
global

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
05 Aug 2015 11:50 PM
It is:
local Player = Brick.Parent:FindFirstChild("Humanoid")
Roblox is very inconsistent with capitalization, you need the capital F

On and on south of heaven | Previously: awesom914
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
06 Aug 2015 12:01 AM
"Roblox is very inconsistent with capitalization, you need the capital F"

huh

well it still broke

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
06 Aug 2015 12:23 AM
Oh, it should be Score.Value instead of Scores.Value

On and on south of heaven | Previously: awesom914
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
06 Aug 2015 12:42 AM
well it isn't breaking anymore but it also isn't displaying a random number on the leaderboard

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
06 Aug 2015 12:43 AM
You didnt even parent the values
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
06 Aug 2015 12:46 AM
"You didnt even parent the values"

what values should I have parented

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
06 Aug 2015 03:01 PM
bump

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
jarednotanoob is not online. jarednotanoob
Joined: 30 Oct 2011
Total Posts: 7579
06 Aug 2015 03:28 PM
bump2

http://www.roblox.com/Purple-Valkyrie-Helm-item?id=229707861
Report Abuse
ElectoStriking is not online. ElectoStriking
Joined: 10 May 2014
Total Posts: 1547
06 Aug 2015 03:36 PM
I think it is scores.value.parent...
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