Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 23 Oct 2011 03:20 PM |
| I am making a donation gui, it works great in play solo, but when I test it in a real server it wont work :l. Any help? |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
| |
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 24 Oct 2011 06:07 PM |
| really no help in 1 day.. :l |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 24 Oct 2011 06:09 PM |
| Really, expects help without showing code? |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
| |
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 24 Oct 2011 06:12 PM |
local stat = "Cash" ---------------------------------------------------------------------------------- ----------------------------------------------------------------------------------
local player = game.Players.LocalPlayer local gui = script.Parent local m = gui.Main local open = gui.Open local amount = m.Amount local plyr = m.Player local title = m.Title local donate = m.Donate
function playercheck(string) local count = 0 local valid = {} for _,v in next, game.Players:GetPlayers() do if v.Name:sub(0,string:len()):lower() == string:lower() then count = count+1 table.insert(valid,v) end end if count == 1 then return valid[1] end return false end
open.MouseButton1Click:connect(function() if m.Visible then m.Visible = false open.Text = "Open Donate" else m.Visible = true open.Text = "Close Donate" end end)
donate.MouseButton1Click:connect(function() local donateamount = tonumber(amount.Text) if donateamount and donateamount>0 then local donateplayer = playercheck(plyr.Text) if donateplayer then if player.leaderstats[stat].Value >= donateamount then player.leaderstats[stat].Value = player.leaderstats[stat].Value - donateamount donateplayer.leaderstats[stat].Value = donateplayer.leaderstats[stat].Value + donateamount else title.Text = "You don't have enough "..stat.."." wait(2) title.Text = "Donate" end else title.Text = "Not a valid player" wait(2) title.Text = "Donate" end else title.Text = "Not a valid amount" wait(2) title.Text = "Donate" end end)
There :)
|
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
| |
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
| |
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 24 Oct 2011 06:24 PM |
| As long as you indent it in your editor, I can see the tabs with the forum enhancer |
|
|
| Report Abuse |
|
|
Kalandri
|
  |
| Joined: 25 Sep 2010 |
| Total Posts: 26 |
|
| |
|
|
| 24 Oct 2011 06:26 PM |
| Never use LocalPlayer! Use script.Parent.Parent.Etc... If you know what I mean. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 24 Oct 2011 06:27 PM |
> Never use LocalPlayer
Why? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:28 PM |
> Why?
Because it's not as good... Shorter, but you have to check for it or use a LocalScript, but don't get me wrong I love using LocalScripts. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 24 Oct 2011 06:30 PM |
> Shorter, but you have to check for it
Why? Isn't it guaranteed? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:32 PM |
> Why? Isn't it guaranteed?
Stop with the freaking '>' before I knock your teeth in, also no it's not. Lol. |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 24 Oct 2011 06:32 PM |
| Sly, I'm using a local script |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:35 PM |
| Okay then, now use a normal script; then use the parents instead of the LocalPlayer. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 24 Oct 2011 06:35 PM |
> Stop with the freaking '>'
Sorry, couldn't resist. It's part of the Forum Enhancer Markdown syntax.
Why isn't it guaranteed to be set when accessed from a `LocalScript`? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:41 PM |
| NXT, I don't know. It should of been like a year ago. I didn't know ROBLOX would screw that up too... |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 24 Oct 2011 06:47 PM |
| So, what can I do to fix it? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:52 PM |
| Grove, I already told you! |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 24 Oct 2011 06:54 PM |
| Oh sorry didn't see that :P |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2011 06:55 PM |
| Sly, that wouldn't fix the problem... |
|
|
| Report Abuse |
|
|
| |
|
| |
|