#cannot use remote idk why (The current thread cannot use 'teleport_remote' (lacking capability Unas)
1 messages · Page 1 of 1 (latest)
im using my simple remote module
local RunService = game:GetService("RunService")
local Constructor = {}
function Constructor.new(name: string): RemoteEvent?
local is_server = RunService:IsServer()
local search_name = `{name}_remote`
if is_server then
local remote = script:FindFirstChild(search_name)
if not remote then
remote = Instance.new("RemoteEvent", script)
remote.Name = search_name
end
return remote
else
local remote = script:WaitForChild(search_name, 5)
if not remote then
warn("[EasyRemote] Failed to find remote event on client:", search_name)
end
return remote
end
end
function Constructor.Bindable(name: string): BindableEvent
local search_name = `{name}_bindable`
local remote = script:FindFirstChild(search_name) :: BindableEvent?
if not remote then
remote = Instance.new("BindableEvent", script)
remote.Name = search_name
end
return remote
end
function Constructor.Function(name: string): RemoteFunction?
local is_server = RunService:IsServer()
local search_name = `{name}_function`
if is_server then
local remote = script:FindFirstChild(search_name)
if not remote then
remote = Instance.new("RemoteFunction", script)
remote.Name = search_name
end
return remote
else
local remote = script:WaitForChild(search_name, 5)
if not remote then
warn("[EasyRemote] Failed to find remote function on client:", search_name)
end
return remote
end
end
return Constructor
Wdym “{name}_remote”?
You are literally searching “{name}_remote”
And you are making the new remote”s name “{name}_remote”
yep
You gotta type, local search_name = name .. “remote”, if you want it like that
like, teleport_remote
nah bro
Local search_name = name .. “_remote”
its work the same