OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 24 Jun 2015 10:19 AM |
So I made a noclip command for my admin. At first I thought everything worked fine, then I joined on mobile into the same game on my alt and started noclipping, but I didn't move anywhere until I stopped to do it on the alt's screen, well obviously FE blocks this.
Now I'm trying to send my torso's CFrame in RemoteEvent and move the torso from ServerScript, yeah it works great until I stop moving mid air when it teleports my body to the position I started noclipping from. I have no clue why it does this because I am still sending the CFrame of my torso from client to server:
client:
while wait() and torso and hum and ncing do torso.CFrame = CFrame.new(torso.Position,cam.CoordinateFrame.p) * CFrame.Angles(0,math.rad(180),0) * CFrame.new((dir[Enum.KeyCode.D]-dir[Enum.KeyCode.A])*flyspeed,0,(dir[Enum.KeyCode.S]-dir[Enum.KeyCode.W])*flyspeed) ncevent:FireServer(torso.CFrame) end
server, as simple as:
nclipevent.OnServerEvent:connect(function(plr,cframe) print("MOVING") plr.Character.Torso.CFrame = cframe end)
it keeps printing MOVING even if I am not moving while noclipping which is what I want of course(I added it just to see if it stops firing for some reason, u kno), but the fact that I'm still teleported to the first position on everyone else's screen bugs me.
oh and does this make lag a lot if there are many people firing a RemoteEvent every .03 second?
I tried using my fly function and setting CanCollide to false from Head and Torso, but I wasn't able to go through walls.
|
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 24 Jun 2015 01:57 PM |
b
yea I didn't really expect an answer on this one |
|
|
| Report Abuse |
|
|
tyzone
|
  |
| Joined: 16 Aug 2008 |
| Total Posts: 1726 |
|
|
| 24 Jun 2015 02:51 PM |
You're directly sending the server your torso's CFrame, and are basically asking the server to set your torso's CFrame to your torso's CFrame.
I understand that moving your torso through a local script may allow you to do this while moving, but it will probably lead to some errors, as the server's commands may override yours and put you back where you were anyway.
-----------------------------
local cf = CFrame.new(blah blah calculus shmalculus) ncevent:FireServer(cf)
-----------------------------
This might work a bit better imo.
As for the second question, CFraming a bunch of parts all the time may cause some problems regarding performance, yes. Same goes for constantly changing the parts' velocity property. I'd advise you to use something like BodyVelocity, as BodyMovers of any type usually result in less lag than doing the math yourself.
eww no pink shaggy |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 25 Jun 2015 04:01 AM |
I forgot to mention that I have already tried that, sending the CFrame and only moving it from server script instead of both, but I wasn't able to move anywhere.
And what comes to BodyMovers, as I said I tried using my fly function(where i again forgot to mention i used bodymovers) and setting Head's and Torso's CanCollide to false but ROBLOX apparently blocks this as they come back true right after..? so I wasn't able to go through walls which is obviously the whole point of noclip.
well I guess I could change every single part in the whole game to CanCollide false (if they are set to true ofc) locally and back to true when player stops noclipping but that could lead to problems such as, what if there's a part that automatically changes its CanCollide and that stuff.
|
|
|
| Report Abuse |
|
|