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: Adjusting Leaderstat values with RemoteEvents and FE...

Previous Thread :: Next Thread 
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 11:53 AM
Anyone???


"Everybody has a chapter they don't read aloud."
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 01:07 PM
Can anyone please help??


"Everybody has a chapter they don't read aloud."
Report Abuse
HlCOM is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
18 Oct 2016 01:24 PM
post the script
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 02:17 PM
qq


"Everybody has a chapter they don't read aloud."
Report Abuse
HlCOM is not online. 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
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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 is not online. 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
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 05:44 PM
PLEASE SOMEONE


"Everybody has a chapter they don't read aloud."
Report Abuse
Lykaon is not online. Lykaon
Joined: 27 Oct 2014
Total Posts: 784
18 Oct 2016 06:02 PM
wait whats your goal


Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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 is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
18 Oct 2016 06:07 PM
they cant change leaderstat values if its fe
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
18 Oct 2016 06:09 PM
THIS IS SO INCREDIBLY MORONIC THAT I CAN'T EVEN COMPREHEND WHAT YOU'RE ASKING
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 06:17 PM
@Real sorry I just need help qq


"Everybody has a chapter they don't read aloud."
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
18 Oct 2016 06:52 PM
anyooneeee plleeassseeee


"Everybody has a chapter they don't read aloud."
Report Abuse
iCherryBeary is not online. iCherryBeary
Joined: 10 Feb 2012
Total Posts: 1000
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 is online. 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 is online. 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
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