Hi, ive tried using this module, but ive seen to have some issues with it.
For some odd reason when i want the gui to look to left by setting the y to math.rad(-15) it goes off the screen, no idea how to fix it.
heres my code:
local RS = game:GetService(“ReplicatedStorage”)
local Event = RS:WaitForChild(“Remotes”):WaitForChild(“EquipEvent”)
local skillsetModule = require(RS:WaitForChild(“SkillSets”))
– 3D GUI Setup
local mainUI: ScreenGui = script.Parent
local screenGen = require(RS:WaitForChild(“Assets”):WaitForChild(“Modules”):WaitForChild(“Screen3D”))
local screen3D = screenGen.new(mainUI, 1)
– Helper function to safely wait for a child with a timeout
local function waitForChildWithTimeout(parent, childName, timeout)
local startTime = os.clock()
while not parent:FindFirstChild(childName) do
if os.clock() - startTime > timeout then
warn(“Timeout waiting for:”, childName)
return nil
end
task.wait(0.1)
end
return parent:FindFirstChild(childName)
end
– Wait for the Container to exist (created by Screen3D if needed)
local container = waitForChildWithTimeout(mainUI, “Container”, 5)
if not container then
error(“Container was not found after waiting. Make sure it exists in GUI or is created by Screen3D.”)
end
– Set up UI3d AFTER container is found
local UI3d = screen3D:GetComponent3D(container)
UI3d:Enable()
UI3d.offset = CFrame.Angles(math.rad(0), math.rad(-5), math.rad(0))
– Store references to frames
local frames = {}
for i = 1, 6 do
local frame = waitForChildWithTimeout(container, “Frame” … i, 5)
if not frame then
error(“Frame” … i … " not found!")
end
frames[i] = frame
end
– Helper to update GUI skill text
local function updateSkillText(skills)
for i, frame in ipairs(frames) do
local imageLabel = waitForChildWithTimeout(frame, “ImageLabel”, 5)
if imageLabel then
local textLabel = waitForChildWithTimeout(imageLabel, “TextLabel”, 5)
if textLabel then
textLabel.Text = skills[i] or “N/A”
else
warn(“TextLabel missing in Frame” … i)
end
else
warn(“ImageLabel missing in Frame” … i)
end
end
end
– Listen to EquipEvent
Event.OnClientEvent:Connect(function(toolName, action)
print(“Received:”, toolName, action)
if action == "Equipped" then
local skillSet = skillsetModule[toolName]
if not skillSet then
warn("No skill set found for tool: " .. toolName)
updateSkillText({"N/A", "N/A", "N/A", "N/A", "N/A", "N/A"})
return
end
local eSkill = skillSet["E"] and skillSet["E"].Key or "N/A"
local rSkill = skillSet["R"] and skillSet["R"].Key or "N/A"
local tSkill = skillSet["T"] and skillSet["T"].Key or "N/A"
local m1Skill = skillSet["M1"] and skillSet["M1"].Key or "N/A"
local m2Skill = skillSet["M2"] and skillSet["M2"].Key or "N/A"
local qSkill = skillSet["Q"] and skillSet["Q"].Key or "N/A"
updateSkillText({eSkill, rSkill, tSkill, m1Skill, m2Skill, qSkill})
else
updateSkillText({"N/A", "N/A", "N/A", "N/A", "N/A", "N/A"})
end
end)