Hello! I tried using this module: https://devforum.roblox.com/t/object-x-ray-highlighting-system/243531 to make it so that when a player presses Z he gets to see other people. It didn't work though, does anyone know why? Can anyone help me with a better code?

local players = game.Players
local player = players.LocalPlayer
local mouse = player:GetMouse()  

local db = false
local ObjectHighlight = game.ServerScriptService.ObjectHighlight

mouse.KeyDown:connect(function(key)
    if key == "z" then
     if db == false then
        if player.LevelsInfo.Level.Value >= 15 then
            if player.PlayerScripts.Ability.Value == "TimeLeap" then
                for i, player in ipairs(game.Players:GetPlayers()) do
                    if player.Character then
                        local Character = player.Character
                        if Character then
                                local HighlightObject = require(ObjectHighlight).new(
                                Character,
                                Color3.new(0,1,0),
                                false,
                                50,
                                0
                                )
                            end
                        end
                    end
            end 
        end
    end
 end
end)

2 comments

0

"player.LevelsInfo.Level" Tell me where are you referencing from

0

It's just levels. Nothing important.