|
| 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 |
|
|
| |
|
| |
|
|
| 23 Feb 2017 04:18 PM |
if exp == (number) then -put stuff here end |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Feb 2017 04:23 PM |
| ### It would be ############################ Lol you put value before exp xD |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2017 04:23 PM |
Oh no tags strike again
You put value before exp lol |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 23 Feb 2017 04:45 PM |
| No parenthesis around 15 needed. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2017 05:15 PM |
| either way thats not the problem |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
| |
|
|
| 23 Feb 2017 09:10 PM |
| is this a server script or a local script? |
|
|
| Report Abuse |
|
|