edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
|
| 06 Oct 2015 03:10 PM |
I've been messing around with a bullet mechanic in solo, but once going online, it freezes up because "RenderStepped" is unusable by the server. Is there any method the server can use to imitate this? |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 06 Oct 2015 03:11 PM |
if you need renderstepped in server you're doing it wrong
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:11 PM |
Yep, also isn't it runservice.Hearbeat for server??
morashsPeasant is doing homework :/ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 06 Oct 2015 03:12 PM |
there are very limited times where you'd actually need such a small wait time
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:14 PM |
@litalela, YES. lol
morashsPeasant is a peasant |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:17 PM |
| Use .Stepped on the server |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:29 PM |
well, you can do something like this
i=1
while true do --code i=i+1 if i==3 then i=0 wait() end end
but it is very inefficient |
|
|
| Report Abuse |
|
|
edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
|
| 06 Oct 2015 03:39 PM |
I'm using Stepped now, but because of the 1/60th to 1/30th of a second change, the bullets are running slower than desired :/ Cheers anyway guys! |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:44 PM |
You should be simulating the bullets on the client and doing actual hit detection on the server.
deriving center servers |
|
|
| Report Abuse |
|
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 06 Oct 2015 03:54 PM |
for i=1,100 do print("hi") coroutine.yield() end
Red Blossoms |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:57 PM |
| you shouldnt be cframing/positioning bullets, use bodygyros bodyvelocities bodypositions etc |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 03:57 PM |
I like what @DermonDarble says. However, think if you were to do that (and you wanted other players to see it) you would have to set up an event so all clients (perhaps within a range) can see it.
You could use RemoteEvents and hook up a local script to fire it to a server script (using renderstepped). Or you can change the wait time in the settings. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 04:05 PM |
if you want to control it from character, you can also use
-- server script
local GiveAccess = game:GetService("ReplicatedStorage").GiveAccess -- a remote event
local function GrantAccess(Player, Object) if Object:IsDescendantOf(workspace) then Object:SetNetworkOwner(Player) -- makes it so local scripts can change positions and everyone will see it end end GiveAccess.OnServerEvent:connect(GrantAccess) -- on activated
-- then activate from a local script and change the parts cframe using renderstepped it will work |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2015 04:34 PM |
Goes slower than desired?
1 stud every 60th of a second is the same as 2 studs every 30th of a second. Simply double their speed. |
|
|
| Report Abuse |
|
|
edenojack
|
  |
| Joined: 18 Jul 2008 |
| Total Posts: 989 |
|
|
| 06 Oct 2015 04:56 PM |
Okay heres how its hooked up Using Filtering Enabled, When a player clicks, the game recieves an event which has the details of a gun and the direction in which it faces. From this information it "Fires" a bullet using iterated RayCasting to ensure that the bullets do not go through walls, or bounce, or deviate from their course. This is an issue that parts using BodyMovers face. At the moment, the server controls the bullets for everyone, this is to ensure that if one computer runs faster than another (Rendering wise) that their bullets do not run faster then someone elses.
This is before fixing, after fixing I did just what Warpsy suggested, realizing that it halves the movement time. The issue now is with the Particles, there are huge gaps between them. This is fixable.
What is a likely better choice is to find a way of creating and handling all of the bullets via the client THEN replicating the bullets to the server. The issue following is how these are seen on other clients.
Thank you for your help guys, will be fixing soon. |
|
|
| Report Abuse |
|
|