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: Help needed, not too complicated

Previous Thread :: Next Thread 
Anthony9299 is not online. Anthony9299
Joined: 04 Aug 2012
Total Posts: 58
03 Aug 2016 11:27 AM
Guys help I cannot detect player name and change rank of it.

Here is the original script.

game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new('IntValue', player)
stats.Name = 'leaderstats'
local rank = Instance.new('StringValue', stats)
rank.Name = 'Rank'
rank.Value = 'Visitor'
local attime = Instance.new('IntValue', stats)
attime.Name = 'Time'
attime.Value = 0

if game.Players.LocalPlayer.Name == 'Anthony9299' then
player.leaderstats.Rank.Value = "Host"
end

while true do
wait(1)
attime.Value = attime.Value + 1
end
end)
Report Abuse
triode is not online. triode
Joined: 13 Aug 2011
Total Posts: 5844
03 Aug 2016 11:31 AM
You forgot to parent the values into the player
Report Abuse
Anthony9299 is not online. Anthony9299
Joined: 04 Aug 2012
Total Posts: 58
03 Aug 2016 11:37 AM
What do you mean...? I don't actually understand... Sorry :/
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
03 Aug 2016 11:43 AM
playeradded only works in serverscripts
localplayer only works in localscript




This siggy is copyrighted ©
Report Abuse
Anthony9299 is not online. Anthony9299
Joined: 04 Aug 2012
Total Posts: 58
03 Aug 2016 11:48 AM
Still now specific... Just tell me how to detect a specific player name ;_;
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 11:54 AM
I think this might help.
player = game.Players:FindFirstChild("Anthony9299")

if player then
rank.Value = "Host"

(FYI this rank.Value will not work. Just a demonstration.)
Report Abuse
Anthony9299 is not online. Anthony9299
Joined: 04 Aug 2012
Total Posts: 58
03 Aug 2016 12:00 PM
There is only one problem... I still cannot change it :P
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 12:05 PM
what do you mean you cannot change the name.
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
03 Aug 2016 12:17 PM
Here is a script that I know about that will actually help you.
Playerstats = {}

game.Players.PlayerAdded:connect(function(player)

Playerstats[player] = {}
Playerstats[player]['Rank'] = 0

local stats = Instance.new("Model", player)
stats.Name = "Stats"

local rank = Instance.new("IntValue", stats)
rank.Name = "Rank"
rank.Value = Playerstats[player]['Rank']
end)

while wait() do
for _, player in ipairs(game.Players:GetPlayers())do
player.stats.rank.Value = Playerstats[player]['Rank'] + 1

if player:FindFirstChild('Playerstats') then
Playerstats[player]['Rank'] = Playerstats[player]['Rank']
end
end
end
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
03 Aug 2016 12:21 PM
server script, serverscriptstorage


game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new('IntValue', player)
stats.Name = 'leaderstats'
local rank = Instance.new('StringValue', stats)
rank.Name = 'Rank'
rank.Value = 'Visitor'
local attime = Instance.new('IntValue', stats)
attime.Name = 'Time'
attime.Value = 0

if player.Name == 'Anthony9299' then
player.leaderstats.Rank.Value = "Host"
end

while true do
wait(1)
attime.Value = attime.Value + 1
end
end)


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