Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need little help with client and server communication problem?

Asked by 5 years ago

So basically I have Local script for turning ssj (super saiyan) when i type ssj in the chat characters accessories removes and it spawn a super saiyan hair with aura the thing is only I can see my form my friend cant see my form and i cant see his form how to do so players can see each others forms? (by the way, I know this has to do with RemoteEvent and RemoteFunction but I really don't know still how am I suppose to write the script so it works)

0
This isn’t because of RemoteEvents, these are the tools for bypassing the restriction to the Server. Ever since FilteringEnabled was imposed on Scripts following Experimental Mode, the Server deems the Client untrustworthy and doesn’t broadcast to the rest of the other Clients. This is why you can’t see your change Ziffixture 6913 — 5y
0
The primitive solution is to have the Server reconstruct the Characters look. Ziffixture 6913 — 5y
0
Oh, I answered about this a couple seconds before you did... I just hope he reads both of ours blockmask 374 — 5y

1 answer

Log in to vote
0
Answered by
blockmask 374 Moderation Voter
5 years ago
Edited 5 years ago

Ok, I'll help you out a little with remote events and client to server communication.

When doing things on a client, it won't replicate to the server, and this can be an advantage and a disadvantage at the same time. Let's say you were setting a humanoid's walkspeed to x then print out the walkspeed later, it will print x, but let's say you went on the server, waited a couple seconds, then printed out the walkspeed, it'll just print 16 since it changed on the client, and not on the server. But everything from the server will be replicated to the client.

So for the sji thing that you're talking about. You'll want to check on a server script because you can NEVER TRUST THE CLIENT. So in a server script, you'll use the Chatted event on the player.

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)

    end)
end)

Now we have to check for the message, under the .Chatted, type

if (message == "message") then
    --make the transformation
end

Now, the reason we say you shouldn't trust the client is because some exploiters can change their name to receive special perks in your name, fake owning a gamepass, and more

0
Accept this answer if it helped blockmask 374 — 5y
Ad

Answer this question