|
| 18 Oct 2016 11:28 AM |
Hello everyone, thanks for reading thus far.
I currently have a script that adjusts a player's leaderstats by firing a remote event. What it does is it passes a Gamepass ID Value, the player, and the scripts parent's name through a localscript to a serverscript that fires when the event is fired when the Parent is clicked. The leaderstat, after checking if the player has the gamepass, is then changed to the scripts parent's name.
This is under an ImageButton that is fired using the MouseButton1Click event. The game IS FilteringEnabled. The script runs in studio of course, but when using a Test Server and actually playing, it does not work.
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 11:53 AM |
Anyone???
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 01:07 PM |
Can anyone please help??
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
| |
|
|
| 18 Oct 2016 01:25 PM |
changeSkin.OnServerEvent:connect(function(plr, id, name) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,id.Value) then plr.leaderstats:FindFirstChild("Current Skin").Value = name else print("You do not have this gamepass!") end end)
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 02:17 PM |
qq
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 18 Oct 2016 02:19 PM |
"if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,id.Value) then"
"(plr,id.Value)"
what is id? is it numbers or is it an actual object like "IntValue" |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 02:20 PM |
id is an intValue that has the gamepass id in it.
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
Parabolt
|
  |
| Joined: 03 Dec 2010 |
| Total Posts: 21576 |
|
|
| 18 Oct 2016 02:21 PM |
dam cherry is there anything you cant do????
and "Everybody has a chapter they don't read aloud." is one of my fav quotes
+100 respek
|
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 02:26 PM |
Yep, I can't get this supposedly simple script to work qq
And yeah I really like it xD
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 05:44 PM |
PLEASE SOMEONE
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
Lykaon
|
  |
| Joined: 27 Oct 2014 |
| Total Posts: 784 |
|
| |
|
|
| 18 Oct 2016 06:05 PM |
To adjust the user's leaderstat value through a server script in ServerScriptService instead of doing it through the localscript so it can't be easily hacked I think?xD
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 18 Oct 2016 06:07 PM |
| they cant change leaderstat values if its fe |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 06:08 PM |
What do you mean? Server scripts can't? And if so, how do I bypass that safely without giving user's access to it??
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 06:09 PM |
| THIS IS SO INCREDIBLY MORONIC THAT I CAN'T EVEN COMPREHEND WHAT YOU'RE ASKING |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 06:17 PM |
@Real sorry I just need help qq
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 06:52 PM |
anyooneeee plleeassseeee
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2016 07:19 PM |
Oh my goodness I didn't think this would be this hard to answer Dx
"Everybody has a chapter they don't read aloud." |
|
|
| Report Abuse |
|
|
Dev_Ryan
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 243 |
|
|
| 18 Oct 2016 07:51 PM |
Try going through your code and adding prints to see if something isn't working as it should.
Example:
changeSkin.OnServerEvent:Connect(function(plr, id, name) if plr and id and name then if game:GetService("RunService"):IsStudio() then print("Studio Detected. Can't use MarketplaceService in studio.") else if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, id) then if plr:FindFirstChild("leaderstats") then local CurrentSkin = plr.leaderstats:FindFirstChil("Current Skin") if CurrentSkin then CurrentSkin.Value = tostring(name) else print("Could not find Current Skin.") end else print("Could not find leaderstats.") end else print("You do not have this gamepass!") end end else print("One of the variables passed was nil.") end end)
|
|
|
| Report Abuse |
|
|
Dev_Ryan
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 243 |
|
|
| 18 Oct 2016 07:53 PM |
Also instead of doing id.Value, just send the value through the event instead of the object containing the value.
|
|
|
| Report Abuse |
|
|