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: How do i take value from Leadbored?

Previous Thread :: Next Thread 
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 01:18 PM
.
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 01:43 PM
b
Report Abuse
iPadtutorial99 is not online. iPadtutorial99
Joined: 09 Feb 2014
Total Posts: 71
17 Oct 2015 01:59 PM
Depends, if you want a brick to give you points, heres what I would use (instert a local script into a part)

repeat wait()
player = game.Players.LocalPlayer
leaderboard = player.leaderstats
until
points = 5
function givePoints()
leaderboard.Points.Value = leaderboard.Points.Value + points --Might need to change this depending on what you called your leaderstat for the points.
end
script.Parent.Touched:connect(givePoints)
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:01 PM
What if I want to detect if player has like 4 kills?
Report Abuse
iPadtutorial99 is not online. iPadtutorial99
Joined: 09 Feb 2014
Total Posts: 71
17 Oct 2015 02:02 PM
FACEPALM Read the wrong thing...
(normal script)
function getPoints()
local player = game.Players.LocalPlayer
local points = player.leaderstats.Points
end
script.Parent.Touched:connect(getPoints)
Report Abuse
iPadtutorial99 is not online. iPadtutorial99
Joined: 09 Feb 2014
Total Posts: 71
17 Oct 2015 02:05 PM
If you wanna detect the player has 4 kills, use a normal script.

function detect()
local playerleads = game.Player.LocalPlayer.leaderstats.Kills
if playerleads.Value >= 4 then
print("Run your code here.")
end
end
script.Parent.Touched:connect(detect)
Report Abuse
GrandSnaf is online. GrandSnaf
Joined: 28 Mar 2015
Total Posts: 111
17 Oct 2015 02:05 PM
while true do
wait()
for _,player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
local stats = player.leaderstats
if stats:FindFirstChild("Kills") then
local kills = stats.kills
if kills.Value == 4 then

end
end
end
end
end
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:05 PM
function getPoints()
local player = game.Players.LocalPlayer
local kills = player.leaderstats.Kills
end
script.Parent.Touched:connect(getPoints)

So if kills == 4
then do this and that?
Report Abuse
iPadtutorial99 is not online. iPadtutorial99
Joined: 09 Feb 2014
Total Posts: 71
17 Oct 2015 02:07 PM
It's the simplest way. People just make it so hard...
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:15 PM
i cant grasp the concept

i did this wrong at the bottom

how do i make it so when player has 4 kills it changes the rank

game.Players.PlayerAdded:connect(function(player)
local statsFolder = Instance.new("Folder", player)
statsFolder.Name = "leaderstats"
local cash = Instance.new("IntValue", statsFolder)
cash.Name = "Kills"
local rank = Instance.new("StringValue", statsFolder)
rank.Name = "Rank"
end)

while true do
wait()
for _,player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
local stats = player.leaderstats
if stats:FindFirstChild("Kills") then
local kills = stats.kills
if kills.Value == 4 then
stats:FindFirstChild("Rank") == ("Level 1")



end
end
end
end
end
Report Abuse
Scripterity is not online. Scripterity
Joined: 30 Mar 2014
Total Posts: 677
17 Oct 2015 02:21 PM
@iPad Leave, you just told him to put a script, that uses LocalPlayer, inside of a server-side script.
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:23 PM
>.< im so confused

so should i be using reg script or local script
Report Abuse
GrandSnaf is online. GrandSnaf
Joined: 28 Mar 2015
Total Posts: 111
17 Oct 2015 02:29 PM
Epic, stats:FindFirstChild("Rank") == ("Level 1") should be stats:FindFirstChild("Rank").Value = stats:FindFirstChild("Rank").Value + 1
Report Abuse
GrandSnaf is online. GrandSnaf
Joined: 28 Mar 2015
Total Posts: 111
17 Oct 2015 02:31 PM
im sorry, it should be stats:FindFirstChild("Rank").Value = "Rank 1"

sorry :3
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:40 PM
o thanks it worked!
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 02:43 PM
Okay now for math

in lua how do I make it so if kills is between 4 and 12 then we do this?
Report Abuse
GrandSnaf is online. GrandSnaf
Joined: 28 Mar 2015
Total Posts: 111
17 Oct 2015 02:45 PM
if Kills.Value > 4 and Kills.Value < 12 then

end
Report Abuse
GrandSnaf is online. GrandSnaf
Joined: 28 Mar 2015
Total Posts: 111
17 Oct 2015 02:46 PM
simple way of doing it
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 03:12 PM
How do i put a loop so it checks how many kills the player have?
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 03:13 PM
while true do
wait()
for _,player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
local stats = player.leaderstats
if stats:FindFirstChild("Kills") then
local Kills = stats.Kills
if Kills.Value == 0 then
stats:FindFirstChild("Rank").Value = "Citizen"
elseif Kills.Value > 4 and Kills.Value < 12 then
stats:FindFirstChild("Rank").Value = "Soilder"
else
print("..")


end
end
end
end
end
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 03:23 PM
isnt this suppose to be on a loop anyways?
it has while true do
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 03:48 PM
.
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 04:45 PM
.,
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 05:41 PM
help
Report Abuse
EpicMinions is not online. EpicMinions
Joined: 28 Jun 2013
Total Posts: 142
17 Oct 2015 06:43 PM
.
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