Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 20 Aug 2013 03:11 PM |
A=script.Parent.Ammo r=script.Parent.Reload ac=script.Parent.AC
function clip() local ccc=script.Parent.Mag:clone() ccc.Parent=game.Workspace ccc.CFrame = script.Parent.Mag.CFrame - Vector3.new(0,1,0) ccc.CanCollide = true local r = script.Parent.RM:clone() r.Parent = ccc r.Disabled = false print("IT COPIED") end
r.Changed:connect(function() if r.Value == true then if ac.Value >= ammount then Tool.Ready.Value = false re=true clip() script.Parent.Mag.Transparency = 1 wait(4) script.Parent.Mag.Transparency = 0 c.Value = ammount ac.Value = ac.Value - ammount A.Value = A.Value - 1 Tool.Ready.Value = true r.Value=false elseif ac.Value < 0 then Tool.Ready.Value = false re=true clip() script.Parent.Mag.Transparency = 1 wait(4) script.Parent.Mag.Transparency = 0 c.Value = ammount Tool.Ready.Value = true r.Value=false end end end)
it works fine in solo, but not in A Server Game |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 20 Aug 2013 03:12 PM |
| If it works fine in solo, put it in a local script because all scripts in Solo are ran locally. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 03:13 PM |
Try adding wait(.2) to the beginning.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 20 Aug 2013 03:17 PM |
| @MeBilly: Right at the beginning? |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Aug 2013 03:19 PM |
Yup. The most common reason for LocalScripts not working on online mode is that the objects they're referencing haven't been sent to the client yet. By that I mean:
Server: Sending script > Client Client: Running script Client: Where is everything else? Server: Sending other parts > Client Client: I'm already broken.
However, by adding a wait(.2) the client will have time for all the other parts to be loaded in.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 20 Aug 2013 03:43 PM |
| Making it local did not work, There's alot to the weapon but this is the part it usually doesn't work at. |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
| |
|
|
| 20 Aug 2013 04:21 PM |
Make sure the script isn't disabled. Also, did you try my wait(.2) idea?
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 21 Aug 2013 07:49 AM |
| It's not disabled, and I don't know exactly where to put the wait. |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
| |
|
|
| 21 Aug 2013 10:58 AM |
Put it at the very very beginning of your script. Before any functions.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2013 10:59 AM |
@Myself Or variables. Especially variables... Put it at the very top of your script. Only once, at the very top.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|