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 » Scripting Helpers
Home Search
 

Re: Script that

Previous Thread :: Next Thread 
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 10:49 PM
clones itself and deletes old script everytime a player dies?

Would that be possible?

Because I have been trying for 3 days for somebody to help fix a script for me but so far the same thing happens - it works fine the first time but no matter what they do it doesn't work when the player respawns

here is the script:

local Name = "Hunger"
local Time = 5
local Player = Game.Players.LocalPlayer
local Person = Player.Character
local Stat = Player.leaderstats[Name]

Stat.Value = 10

while wait(Time) do
Stat.Value = Stat.Value - 1
if Stat.Value == 0 then
break
end
end
Person:BreakJoints()
Report Abuse
UnknownOrangeBanana is not online. UnknownOrangeBanana
Joined: 30 Apr 2012
Total Posts: 93
17 Apr 2013 10:56 PM
Try:
local Name = "Hunger"
local Time = 5
local Player = game.Players.LocalPlayer
local Person = Player.Character
local Stat = Player.leaderstats[Name]

Stat.Value = 10

while wait(Time) do
Stat.Value = Stat.Value - 1
if Stat.Value == 0 then
Person:BreakJoints()
--break
-- haven't been keeping up with Lua; self taught 7 years ago, not sure if break is necessary or what.
end
end
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 10:59 PM
Err
what did you change in it?
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:02 PM
That didn't work :/
Now rather than dying it goes into negatives
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
17 Apr 2013 11:04 PM
Tell me where the script is located and gimmie an Output.

Output: Veiw > Output

Run script

Post error report.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:05 PM
leaderstats is not a valid member of Player is the output
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Apr 2013 11:05 PM


    local Name = "Hunger"
    local Time = 5
    local Player = Game.Players.LocalPlayer
    local Person = Player.Character
    local Stat = Player:WaitForChild("leaderstats"):WaitForChild(Name)
    Stat.Value = 10
    while wait(Time) do
    Stat.Value = Stat.Value - 1
    if Stat.Value == 0 then
    break
    end
    end
    Person:BreakJoints()

Perhaps?

(╯°□°)> KMXD
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:06 PM
23:05:25.567 - leaderstats is not a valid member of Player
23:05:25.568 - Script "local Name = "Hunger"
local Time = 5
local Player = game.P", Line 5
23:05:25.570 - stack end
Report Abuse
UnknownOrangeBanana is not online. UnknownOrangeBanana
Joined: 30 Apr 2012
Total Posts: 93
17 Apr 2013 11:06 PM
Try uncommenting the -- I put for break.
Report Abuse
UnknownOrangeBanana is not online. UnknownOrangeBanana
Joined: 30 Apr 2012
Total Posts: 93
17 Apr 2013 11:07 PM
Ooh, use Knightmare's with a leaderboard script from the models menu.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:09 PM
@knight

Same problem

I think problem may be with my leaderboard script gonna check that
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Apr 2013 11:10 PM
That's weird. If it works once, I don't see why it can't find the leaderstats again unless it disappears. . .

(╯°□°)> KMXD
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:10 PM
Wait what model menu?
Freemodels?
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:12 PM
print("Cash Stuffs running!")

function onPlayerEntered(newPlayer)
wait(.5)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

stats.Parent = newPlayer

local cash = Instance.new("IntValue")

cash.Name = "Hunger"
cash.Value = 10 --This sets the amount of money every player starts with

cash.Parent = stats

stats.Parent = newPlayer

end

game.Players.ChildAdded:connect(onPlayerEntered)


is my current leaderboard script
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
17 Apr 2013 11:14 PM
Change

"local Stat = Player.leaderstats[Name]"

to

local Stat = Player.Hunger
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Apr 2013 11:16 PM
@Killer

But Hunger is parented to Leaderstats.

(╯°□°)> KMXD
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
17 Apr 2013 11:18 PM
I'm not sure if it is right. I'm trying really hard to locate all his variables threw these scripts. I don;t have the actual workspace.

All I know is, leaderstats, is not located in the player.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:20 PM
@Killer
Yeah it doesn't work at all now with local Stat = Player.Hunger
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Apr 2013 11:20 PM
That's the thing; it should be. He's stating it works fine upon first execution, and the code shows the correct parenting. I don't know why the script can't locate the leaderstats again.

(╯°□°)> KMXD
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
17 Apr 2013 11:21 PM
I'd kill to have a picture of your workspace.

The output clearly states, Leaderstats is not inside your player.
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:21 PM
Yeah it's strange
First attempt it finds it
Second and so forth, it can't seem to locate it
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
17 Apr 2013 11:21 PM
Oh, thats different.

Where is this script located?

Workspace?
Character?
Player?
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:23 PM
Location of script:

Game>StarterGUI>LocalScript
Report Abuse
XoDust is not online. XoDust
Joined: 23 Apr 2012
Total Posts: 1401
17 Apr 2013 11:24 PM
It also appears in

Game>Players>XoDust>Player GUI>LocalScript
Report Abuse
machokickface is not online. machokickface
Joined: 12 Aug 2010
Total Posts: 1774
17 Apr 2013 11:25 PM
I think the break ends the loop
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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