Adding on to @cloakedyoshi’s reply, an update was made back in late July that removed Experimental Mode. Even if you untick the FilteringEnabled
property it will not do anything.
Now, more along the lines of the spirit of your inquiry, and as already suggested by others, use remotes. I will specifically use a remote event as nothing really needs to be sent back.
-- # Assuming your game has some RemoteEvent named 'giveGlider' in ReplicatedStorage. Feel free to rename it.
-- # Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local giveGlider = ReplicatedStorage.giveGlider
local glider -- # the glider
giveGlider.OnServerEvent:Connect(function(client, request)
end)
remoteEvent.OnServerEvent
is an event that is listened for on the server side. LocalScripts can call remoteEvent:FireServer(arguments)
to fire remoteEvent.OnServerEvent
, passing the arguments you put in between the parenthesis to the server. The event listener (on the server side) gets a default first parameter. That is the player that fired the remote event. Everything else after that default parameter is what the client sends.
giveGlider.OnServerEvent:Connect(function(client, request)
if request == "glider" then -- # if they request a glider
glider:Clone().Parent = client.Backpack
glider:Clone().Parent = client.StarterGear
end
end)
And from your local script you would call giveGlider:FireServer("glider")
. You do not have to worry about any default arguments when calling remoteEvent:FireServer(arguments)
.
Of course I will leave everything else such as checking if they already own the glider, to you.
Suggestions
Do not use Lighting for storage.
Lighting is not intended for storage. Use ServerStorage and ReplicatedStorage instead, that’s what they are for. Storage.
Stay consistent.
In some areas you are using local variables, and in others you use global variables. You should always be using local variables. Global variables make your codebase a mess. There are more reasons to avoid global variables but I will not explain any further as it is out of the scope of this answer.