Remote Events.


  • Just thought I would give a quick tutorial on remoteevents.
    Basically
    If we want to send a message to the server from the client we would first insert a remoteevent into replicatedstorage. Then in a local script, which does not have to be inside of the remoteevent (it could be in the starterGUI inside of a textButton) we would do the following:

    
    local Button = script.Parent
    
    Button.MouseButton1Click:Connect(function()
    	game.ReplicatedStorage.RemoteEvent:FireServer(script.Parent.Name) 
    end)
    

    For the purpose of this tutorial, I am going to send the name of the TextButton to the server to show you how you can use parameters in RemteEvents. This script tells the RemoteEvent to tell the server we want to do something.

    Next, create a new script into the workspace or ServerScriptService and do the following:

    
    game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player,TextButtonName)
    	--Anything here will run when the TextButton is clicked
    	local Part = Instance.new('Part')
    	Part.Name = 'TestPart'
    	Part.Parent = game.Workspace
    	print(TextButtonName)
    end)
    

    The following script will make it so when the button is pressed, a new part will be created in the workspace. The reason for the player argument in the parameter is because Roblox automatically sends the player, therefore we must put it there. TextButtonName is what was sent from the local script (script.Parent.Name). 'TextButtonName' can be called anything.


  • Konbanwa.

    https://scriptinghelpers.org/questions/68579/can-someone-help-me-fix-devil-beater-im-not-100-sure-how-this-fe-stuff-works#65698

    Plugging my answer here because it literally nutshells Filtering Enabled so well to the point where it could be it's own Blog thread.


  • @Fifkee Thanks. Hopefully this will help those that are struggling with Remote Events and filtering enabled.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.