#Saving users to an array

1 messages · Page 1 of 1 (latest)

warped rampart
#

local Players = game:GetService("Players")
local Remote = game:GetService("ReplicatedStorage").UITrigger1
local ws = game:GetService("Workspace")
local Array = game:GetService("ReplicatedStorage").AddArray
local A1 = ws.Area1
local SpawnPart = A1.Spawn
local TeleportA = A1.Folder.PartA
TeleportA.CanTouch = true
local Section = "Area1"

TeleportA.Touched:Connect(function(hit)
local WhoTouched = hit.Parent:FindFirstChild("HumanoidRootPart")
if WhoTouched then
WhoTouched.CFrame = SpawnPart.CFrame
TeleportA.CanTouch = false

    local character = hit.Parent 
    local player = Players:GetPlayerFromCharacter(character)
    Remote:FireClient(player)
    Array:FireClient(player, Section)
end

end)

the Array:FireClient(player, Section) is supposed to tell the server the name of the "player" and the name of the "Section"
in this case its al3ssandr0_rblx, Area1

local function Decompile (player, Section)
print(player)
print(Section)
end

Remote.OnServerEvent:Connect(Decompile)

it then goes to the server side of the script
where its supposed to print the players name and the section name
but it doesn't
what did I do wrong?

random pollen
#

you're trying to tell the server the name of the player and the name of the section but then you're using :FireClient() instead of :FireServer().