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: Would i use an if statement?

Previous Thread :: Next Thread 
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 04:07 PM
So basically i have this Exp leaderboard
and when u reach a certain number i want it to give you a script
The part that i dont understand is which function would it fall under? Like what function would i use and it's If statement thanks!
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 04:13 PM
Bump?
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 04:16 PM
bump
Report Abuse
Externalization is online. Externalization
Joined: 21 Aug 2013
Total Posts: 13230
23 Feb 2017 04:18 PM
if exp == (number) then
-put stuff here
end
Report Abuse
Externalization is online. Externalization
Joined: 21 Aug 2013
Total Posts: 13230
23 Feb 2017 04:20 PM
oh it's on a leaderboard

for i,player in pairs(game.Players:GetPlayers()) do
if player.leaderstats.Value.Exp == (number) then
--code here-
end
end
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:23 PM
### It would be ############################ Lol you put value before exp xD
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:23 PM
Oh no tags strike again


You put value before exp lol
Report Abuse
Externalization is online. Externalization
Joined: 21 Aug 2013
Total Posts: 13230
23 Feb 2017 04:24 PM
for i,player in pairs(game.Players:GetPlayers()) do
if player.leaderstats.Exp.Value == (number) then
--code here-
end
end


^fixed
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:25 PM
xD good boy
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 04:26 PM
Keep getting a leaderstat is not a valid memeber of player but i legit have no clue it isn't i wish i could show u but its so weird to explain

this is it basically
player = game.Players.LocalPlayer
for i,player in pairs(game.Players:GetPlayers()) do
if player.leaderstats.Experience.Value == (15) then
print("hi")
end
end
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:30 PM
local script = game.Workspace.Script for i, player in ################################ do if ############################## == 50 then local a = script:Clone() a.Parent = player end end
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:31 PM
Lol tags AGAIN.

anyways I made a variable of the script and cloned it into the player using :Clone()
Report Abuse
Negativize is online. Negativize
Joined: 02 May 2011
Total Posts: 25068
23 Feb 2017 04:33 PM
If you're going to check for a certain number, use ## If you're going to check for all numbers above a certain number AND a certain number, use >=
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:34 PM
@negative

Oh yeah I forgot to mention that lol

Yeah >= is over, equal to, while <= is under, equal to.
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 04:40 PM
the only problem is

if player.leaderstats.Experience.Value == (15) then

I dont understand even when i run the script i double check if its in game.Players.leaderstats.Experience.Value
for some reason i get leaderstats is not a valid member of Player
Report Abuse
Disaster_Scripts is not online. Disaster_Scripts
Joined: 10 May 2016
Total Posts: 2310
23 Feb 2017 04:45 PM
No parenthesis around 15 needed.
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 05:15 PM
either way thats not the problem
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 05:22 PM
bump full script




player = game.Players.LocalPlayer
for i,player in pairs(game.Players:GetPlayers()) do
if player.leaderstats.Experience.Value == 15 then
print("hi")
end
end
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 05:31 PM
bump
Report Abuse
KaminaLagann is not online. KaminaLagann
Joined: 16 Jul 2016
Total Posts: 222
23 Feb 2017 05:37 PM
bumpp
Report Abuse
HeIIoISteaIUsernames is not online. HeIIoISteaIUsernames
Joined: 26 Oct 2012
Total Posts: 2906
23 Feb 2017 09:10 PM
is this a server script or a local script?
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