ServerScriptService or StarterCharacterScripts

Hello,

So currently, I am setting Collisions with PhysicsService in ServerScriptService, but when making this, I have also tried putting this inside StarterCharacterScripts, it also works, so it got me wondering if I should be doing this in StarterCharacterScripts or in ServerScriptService, and what would be the cleanest Method for this?

This is the Current Script In Question:

local collision = require(game.ServerStorage.Components.collision) -- PhysicsService module
local user      = require(game.ServerStorage.Components.user) -- StarterPlayer Module

collision.Register("Players", "Players", false) -- Creates CollisionGroup

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		collision.setcollidable(Character, "Players") -- Sets CollisionGorup
	end)
end)

This code works as intended, But after playing around with Both, They both do the Exact same thing with what I’m doing.

Inside StarterCharacterScripts:

local collision = require(game.ServerStorage.Components.collision)
collision.setcollidable(Character, "Players")

So What should I be doing?

1 Like

Player collisions should be done on the server entirely.

serverscriptservice, startercharacterscripts just copies everytime a player joins, serverscriptservice hides ur script away to avoid exploiters.

2 Likes

Yes, I’m doing them on the Server, Whats your point?

I’m not sure, but because you are requesting ModuleScripts I’m the ServerScriptService, StarterCharacterScripts as you are only requering the modules without anything more

Edit: forgot that if it’s not in the Server, it will replicate only to the Player, and Exploiters can control them

My point is you should not need to do anything related to player collisions in StarterCharacterScripts.

Yes, I already know that, But what would be the better Method for Applying CollisionGroups

serverscriptservice cause its much better.

1 Like

Its done on the Server, so they shouldn’t

No I meant, that Exploiters if I’m not wrong can control the scripts in their Character, I might be wrong tho, I’m not an Expert in this

1 Like

I guess this would work.

I didn’t really think ahead so ¯\_(ツ)_/¯

No, you’re not wrong.

You don’t have to be rude about it, and I’m not sure why you are, but thanks anyway.

I was not being rude about it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.