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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 18 Oct 2014 04:38 PM |
| Can you even compare UDim2 values like that? |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2014 04:38 PM |
| assuming this is a local script, replace game.Players.Player to game.Players.LocalPlayer :) |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 18 Oct 2014 05:03 PM |
| @max found it and yes, it is off. |
|
|
| Report Abuse |
|
|
|
| 18 Oct 2014 05:04 PM |
How to use findfirstchild; game.Workspace:FindFirstChild("Part") if found then print 'success' end |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|