davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 12 Sep 2015 04:38 PM |
Spent like 2 hrs on a long script that works completely fine in solo but doesnt work in server/play. No errors, nothing. It is just like a troll sitting on me.
These is the parts of the script that i think might be wrong?
...(code above too) mouse = script.Parent.Parent.Parent.Parent.Parent.Parent:GetMouse() ...(moar code) if --this function doesnt even want to work even though the value is "MLG" game.ServerStorage.Settings.ClickType.Value == "MLG" then script.Parent.Parent.Parent.MLGImages.Hitmarker.Position = UDim2.new(0,mouse.X-27,0,mouse.Y-20) Crazyness() --Main function :/ wait(.25) script.Parent.Parent.Parent.MLGImages.Hitmarker.Position = UDim2.new(1,0,0,0) end ...(even moar code)
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
| |
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 13 Sep 2015 01:53 AM |
y noone even tries to help me? ;-;
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 13 Sep 2015 02:20 AM |
Oh beautiful, now it sometimes errors in server saying that mouse is a nil value.
~davisky~ |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 03:00 AM |
LocalScript
local Player = game:GetService("Players").LocalPlayer -- not script.Parent.Parent.Parent its ugly. local Mouse = Player:GetMouse()
-- Accessing server storage you need to use server side script for that remote event or something -- Move ur frame from local. |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 13 Sep 2015 05:42 AM |
I dont think it will make a diffirence if i will replace script.Parent.... with .LocalPlayer.
~davisky~ |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 08:56 AM |
| Maybe because you can't access the server stroage from local its server side then u cant access mouse either. Use waitforchild |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 09:12 AM |
| k i will try when i have time. |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 09:14 AM |
| Oh btw i can access the serverstorage by pressing the button. Because when i printed the value in serverstorage it was "MLG"... |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2015 09:20 AM |
| Don't trust studio its cursed no seriously server side acts like local script and vice-versa. |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 09:38 AM |
I added this line after the :GetMouse() line... now the button doesnt work anymore...
script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild(mouse)
I know i am doing this wrong.
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 09:52 AM |
Again checked in-game what the problem is... made it also print something if the function get fired. It printed, but the function breaks at the next line:
#code script.Parent.Parent.Parent.MLGImages.Hitmarker.Position = UDim2.new(0,mouse.X-27,0,mouse.Y-20) -i hope i did Roblox+ feature right... if not here is the correct one :/
script.Parent.Parent.Parent.MLGImages.Hitmarker.Position = UDim2.new(0,mouse.X-27,0,mouse.Y-20)
And it errors by saying: attempt to index global 'mouse' (a nil value)
~davisky~ |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2015 10:08 AM |
LocalScript = Client inputs(Mouse, KeyPress) ServerScript = Server Client(Can access ServerStorage and stuff, can't get player mouse.) |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 10:28 AM |
I changed the whole script to a localscript, but it errors at 2nd line now saying: SoundEffects is not (smthng) of ImageLabel.
local snd = script.Parent.Parent.Parent.SoundEffects.SelectMLG --ok, wth.
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 10:35 AM |
Oh and btw, should i make RemoteEvent to a serverscript to check if the .Value is "MLG" or should i leave it in localscript?
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
| |
|
|
| 14 Sep 2015 10:57 AM |
Use this for Studio testing http://wiki.roblox.com/index.php?title=Debugging#Test_-.3E_Start
You can't access ServerStorage or ServerScriptService in a LocalScript. You can't use GetMouse in a Script. correct it. |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 11:01 AM |
Ok, but that still doesnt explain why it errors on that line :L
~davisky~ |
|
|
| Report Abuse |
|
|
| |
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 11:56 AM |
Ok thx for the help. But now there is small one problem. It says :FireClient is not a valid member of LocalScript. :/
forSound:FireClient(player) --errors here... forMems:FireClient(player)
~davisky~ |
|
|
| Report Abuse |
|
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
| |
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
| |
|
davisky2
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 4710 |
|
|
| 14 Sep 2015 01:16 PM |
no1 even looks here :(
~davisky~ |
|
|
| Report Abuse |
|
|