Well, for some reason it gives me the error of attempt to call a nil value, I have no idea why it gives it to me. Well well, I am trying to receive data with OnClientEvent after sending 3 FireClient containing data. However, when “receiving them” it gives me an error. Before this did not happen, I do not know what the problem is
The server script that sends the three FireClient:
local Players = game:GetService("Players")
local TweenService=game:GetService("TweenService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local InventoryRemote = ReplicatedStorage:WaitForChild("InventoryFunctions")
local ToolsFolder = ServerStorage:WaitForChild("Tools")
local Part_base = script.Parent:WaitForChild("base")
local Proximity = script.Parent:WaitForChild("Proximity"):WaitForChild("Interacción_fisica")
local Enabled = false
local Finish = false
Proximity.Triggered:Connect(function(player)
local Position_base = Part_base.CFrame;
local character = workspace:FindFirstChild(player.Name)
--if character then local Get_tool = character:FindFirstChildWhichIsA("Tool") if not Get_tool or Enabled == true then return end
Enabled = not Enabled
if Enabled == false then
--if Get_tool.Name == "Pan" then
--[[Get_tool.Parent = Part_base;
Get_tool.Handle.Anchored = true;
Get_tool.Handle.CFrame = CFrame.new(Position_base.X - 0.6, Position_base.Y*1.45, Position_base.Z + 1.3) * CFrame.Angles(math.rad(0), 0, 1.94)]]
InventoryRemote:FireClient(player, "Mouse_block", false, nil);
InventoryRemote:FireClient(player, "Block_activated_functions", false, nil)
InventoryRemote:FireClient(player, "Move_camera", false, CFrame.new(Position_base.X - 0.3, Position_base.Y*3, Position_base.Z) * CFrame.Angles(math.rad(-90), 0, -14.135))
else
InventoryRemote:FireClient(player, "Mouse_block", true, nil);
InventoryRemote:FireClient(player, "Block_activated_functions", true, nil)
InventoryRemote:FireClient(player, "Move_camera", true, nil)
end
--end
--end
end)
The OnClientEvent Receiver LocalScript:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local InventoryRemote = ReplicatedStorage:WaitForChild("InventoryFunctions")
local player = Players.LocalPlayer
local WaitCharacter = player.Character or player.CharacterAdded:wait(2)
local PlayerGui = player:WaitForChild("PlayerGui")
local Menu_de_mapa = PlayerGui:WaitForChild("MenuDeMapa")
local camera = require(script:WaitForChild("Mouse_block"))
camera:Enable()
player.CharacterAdded:Connect(function()
camera:Disable()
wait(0.5)
camera:Enable()
end)
--OTS_CAMERA_SYSTEM:Disable()
InventoryRemote.OnClientEvent:Connect(function(Service, Bool, other)
if Service == "Mouse_block" then
camera:Send(Bool)
elseif Service == "Block_activated_functions" then
camera:Enabled_or_disabled_click_detector(Bool)
elseif Service == "Move_camera" then
camera:Lock_or_unlock_camera_ubication(Bool, other)
end
end)