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 to make only me and my friend have a certain name

Previous Thread :: Next Thread 
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:27 PM
I tried doing

if player.Name == "OmariHero" then
label.Text = "Owner"
end

but it doesnt work..

player = game.Players.LocalPlayer
local Players = game:GetService("Players")
local races = {"Human", "Human", "Human", "Human", "Human","Human", "Human", "Human", "Human", "Human", "Human", "Human", "Fanalis", "Fanalis", "Fanalis", "Magician"}
label = game.StarterGui.ScreenGui.Frame.TextLabel
math.randomseed(tick())

Players.PlayerAdded:connect(function(onPlayerAdded)
local ranRace = races[math.random(1,#races)]
label.Text = ranRace

if label.Text == "Human" then
game.StarterGui.ScreenGui.Frame.ImageLabel.Image = "http://www.roblox.com/asset/?id=393676778"
end
if label.Text == "Fanalis" then
game.StarterGui.ScreenGui.Frame.ImageLabel.Image = "http://www.roblox.com/asset/?id=393679645"
end

if label.Text == "Magician" then
game.StarterGui.ScreenGui.Frame.ImageLabel.Image = "http://www.roblox.com/asset/?id=393676712"
game.ReplicatedStorage.Wand:Clone().Parent = player.Backpack
end
end)





drazonehero's not main
Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
04 Apr 2016 06:29 PM
Did you try it in a published place. Testing it in studio will make it so your name is either "Player" or "Player1."
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:29 PM
i'm a beginner pls


drazonehero's not main
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:29 PM
yes i did , still gave me the randomized race


drazonehero's not main
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:32 PM
or a link to a video or wiki page that would help with this would be nice :)


drazonehero's not main
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:35 PM
yaaa baby


drazonehero's not main
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 06:41 PM
is it that hard?


drazonehero's not main
Report Abuse
Silicti is not online. Silicti
Joined: 07 Nov 2012
Total Posts: 8242
04 Apr 2016 06:48 PM
Mistake 1:
LocalPlayer can't be defined in a serverscript.

Do this:

game.Players.PlayerAdded:connect(function(player)
if player.Name == "yourusernamehere" then
-- put your function here
end
end)

Make sure this is in a REGULAR script.
Report Abuse
ColonySimulator is not online. ColonySimulator
Joined: 05 Jul 2015
Total Posts: 1721
04 Apr 2016 06:54 PM
or you could make a table/array to verify if the username is in a list of allowed member like


Members = {"Usernamehere",} --Add more username with "NAMEHERE" and dont forget a ,

for i,players in pairs (Members) do
if game.Players.LocalPlayer.Name == players then
-- do stuff here
end
end

Might be not perfect but still close.


Report Abuse
ColonySimulator is not online. ColonySimulator
Joined: 05 Jul 2015
Total Posts: 1721
04 Apr 2016 06:54 PM
My bad I posted this post in the wrong thread I was on multiple thread ignore my post.
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 07:19 PM
neither work :(


drazonehero's not main
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
04 Apr 2016 07:22 PM
because your editing the gui in startergui
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 07:23 PM
so i should edit it in playergui?


drazonehero's not main
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
04 Apr 2016 07:25 PM
scripting is so confusing but it'll be worth it in the long run


drazonehero's not main
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
04 Apr 2016 07:28 PM
edit it in the players playergui, yeah
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