In a game, there was a tool where if you used it, you’d go into a different dimension making yourself invisible to others, but you can also still see yourself.
I’m trying to recreate this in studio. I have the invisibility on server down but I’m having problems making the character visible locally.
I saw a post like this before, but I just need help figuring out why the script doesn’t work.
Script
Tool.Equipped:Connect(function()
Character = Tool.Parent
end)
Tool.Activated:Connect(function()
local CheckPlayer = PlayerCheck(Character)
if not Character and not CheckPlayer and Ready == true then return end
local HRP:BasePart = Character:WaitForChild("HumanoidRootPart")
local WarpPart = Instance.new("Part")
Ready = false
if not IsWarping then
Tool.Name = "Warping..."
HRP.Anchored = true
WarpPart.Parent = workspace
WarpPart.CFrame = HRP.CFrame * CFrame.new(Vector3.new(0,-3,0))
WarpPart.Anchored = true
WarpPart.CanCollide = false
WarpPart.CastShadow = false
WarpPart.Color = Color3.fromRGB(150, 150, 150)
WarpPart.Size = Vector3.new(0.1,0.1,0.1)
WarpPart.Material = Enum.Material.Neon
WarpPart.Transparency = 1
local Charge = TS:Create(WarpPart,TweenInfo.new(2,Enum.EasingStyle.Exponential,Enum.EasingDirection.Out,0,false),{Size = Vector3.new(10,0.1,10);Orientation = Vector3.new(0,360,0);Transparency = 0})
Charge:Play()
Charge.Completed:Wait()
local Warp = TS:Create(WarpPart,TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0,false),{Size = Vector3.new(10,15,10)})
Warp:Play()
Warp.Completed:Wait()
Invisibility(Character)
HRP.Anchored = false
TS:Create(WarpPart,TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0,false),{Size = Vector3.new(0.1,0.1,0.1);Transparency = 1}):Play()
IsWarping = true
Event:FireClient(Players:GetPlayerFromCharacter(Character))
task.wait(0.5)
Ready = true
else
IsWarping = false
Tool.Name = OGName
Invisibility(Character,true)
WarpPart.Parent = workspace
WarpPart.CFrame = HRP.CFrame
WarpPart.Anchored = true
WarpPart.CanCollide = false
WarpPart.CastShadow = false
WarpPart.Color = Color3.fromRGB(150, 150, 150)
WarpPart.Size = Vector3.new(0.1,0.1,0.1)
WarpPart.Material = Enum.Material.Neon
WarpPart.Transparency = 0
local Warp = TS:Create(WarpPart,TweenInfo.new(0.5,Enum.EasingStyle.Exponential,Enum.EasingDirection.Out,0,false),{Size = Vector3.new(10,10,10);Transparency = 1})
Warp:Play()
task.wait(0.5)
Ready = true
end
end)
Local Script
Event.OnClientEvent:Connect(function(plr:Player)
local Character = plr.Character
Invisibility(Character,true)
end)
The error is that the Player’s Character is nil.