Skip to content

Commit

Permalink
improve IS_IMPORTED
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Aug 1, 2024
1 parent d78f52b commit f97ec13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion newmodels_reborn/core/shared_exported.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- !! THIS SCRIPT IS ENTIRELY EXPORTED !!
-- Variable IS_IMPORTED will be true if this script is imported by another resource

-- Variable IS_IMPORTED will be replaced to true
-- when this script is imported by another resource using the import() function
IS_IMPORTED = false

local isClientsideScript = localPlayer ~= nil

Expand Down
2 changes: 1 addition & 1 deletion newmodels_reborn/core/shared_importfunc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function import()
if not exportScriptString or exportScriptString == "" then
return error("Failed to read file.")
end
exportScriptString = "IS_IMPORTED = true\n\n" .. exportScriptString
exportScriptString = exportScriptString:gsub("IS_IMPORTED = false", "IS_IMPORTED = true")
end
return exportScriptString
end

0 comments on commit f97ec13

Please sign in to comment.