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 » Scripting Helpers
Home Search
 

Re: Still doesn't work :/

Previous Thread :: Next Thread 
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 04:26 PM
local gui = game.Players.Player:FindFirstChild('PlayerGui')
if not gui then return end
local slider = gui.Worship.Frame.Slider
local stats = game.Players.Player:FindFirstChild('leaderstats')
if not stats then return end
local worship = stats:FindFirstChild('Worship')
if not worship then return end

if slider.Position > UDim2.new(0,110,0,27) and slider.Position <= UDim2.new(0,190,0,27) then
worship.StringValue.Value = ("R'hllor")

elseif slider.Position < UDim2.new(0,110,0,27) and slider.Position >= UDim2.new(0,20,0,27) then
worship.StringValue.Value = ("Old Gods")

else
worship.StringValue.Value = ("Neutral")

end
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 04:35 PM
bump
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
18 Oct 2014 04:38 PM
Can you even compare UDim2 values like that?
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
18 Oct 2014 04:38 PM
assuming this is a local script, replace game.Players.Player to game.Players.LocalPlayer :)
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 04:42 PM
No. It is a script script (not local) because everyone has to see who the player "worships"... :/
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 04:44 PM
@e I have no idea if that is how you compare UDim values :/
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 04:51 PM
babump
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
18 Oct 2014 04:59 PM
Making it local will not affect anything like that, as long as it's affecting the leaderstats.

idk about FilteringEnabled, that might mess it up
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:00 PM
So how can I fix it. It just stays as the starting leaderboard value....
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
18 Oct 2014 05:01 PM
Turn off filteringenabled
if it's already off, then that's not the problem, obviously
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:02 PM
@max ....Sorry I don't know where filtering enabled is....
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:03 PM
@max found it and yes, it is off.
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
18 Oct 2014 05:04 PM
How to use findfirstchild;
game.Workspace:FindFirstChild("Part")
if found then
print 'success'
end
Report Abuse
Statuezz is not online. Statuezz
Joined: 26 Sep 2013
Total Posts: 131
18 Oct 2014 05:04 PM
I ALMOST FOUND A PRACTICAL USE FOR METATABLES ON ROBLOX AAAAAAAAAAAAAAAAAAAA
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:06 PM
@cp It is finding a child of the player named PlayerGui though....?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
18 Oct 2014 05:07 PM
you use return a lot.

is this even a function?
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:07 PM
Hmmm. It is a Gui so it is local? But the leaderstats are not local are they? Idk what I did wrong in this. It has been bugging me a while....
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:08 PM
This is the whole script. It is in workspace.
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:15 PM
bump
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
18 Oct 2014 05:18 PM
Dude you can't use return in that context, and you can't compare UDim2 values like that
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:20 PM
So how can I fix it? I don't understand....can you just post a slightly edited version of my script?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
18 Oct 2014 05:28 PM
I can't, because tablet. You can't use return if it's not in a function, and you have to compare something like slider.Position.X.Offset to a number or something instead of comparing UDim2 values
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 05:41 PM
@e Ok. I changed it to offset but...Player is not a valid member of Players....

local gui = game.Players.Player:FindFirstChild('PlayerGui')
if not gui then return end
local slider = gui.Worship.Frame.Slider
local stats = game.Players.Player:FindFirstChild('leaderstats')
if not stats then return end
local worship = stats:FindFirstChild('Worship')
if not worship then return end

if slider.Position.X.Offset > 110 and slider.Position.X.Offset <= 190 then
worship.StringValue.Value = ("R'hllor")

elseif slider.Position.X.Offset < 110 and slider.Position >= 20 then
worship.StringValue.Value = ("Old Gods")

else
worship.StringValue.Value = ("Neutral")

end
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 06:03 PM
babump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
18 Oct 2014 06:39 PM
sooooooooooo?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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