Hey, I’m trying to make the “Suke Suke no Mi” from One Piece.
I’m also trying to make the “Area Invisibility” from GPO.
The thing is, I made it so it releases a sphere hitbox and if it touches a part that’s of an npc’s then
it’ll tween the transparency to 1. If it’s of a player’s then it’ll invoke a remote function to tween the localplayer’s character into 0.5 so they can see their own character but other players shouldn’t be able to see their character.
local functions = {}
local targets = {}
local remote = game.ReplicatedStorage.RemoteEvents.Suke.Invisible
function functions.Start(plr)
local tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tweenservice = game:GetService("TweenService")
local chr = plr.Character
local hum = chr:FindFirstChildOfClass("Humanoid")
local health = hum.Health
local sphere = script.Sphere:Clone()
sphere.Parent = workspace.Effects
sphere.Position = chr.HumanoidRootPart.Position
local tween = tweenservice:Create(sphere, tweeninfo, {Size = Vector3.new(38.75, 38.75, 38.75)})
for i, part in pairs(chr:GetDescendants()) do
if (part.Name ~= "HumanoidRootPart" and part:IsA("MeshPart") or part:IsA("Part") and part.Name ~= "HumanoidRootPart") then
local tween2 = tweenservice:Create(part, tweeninfo, {Transparency = 1})
tween2:Play()
part.Material = Enum.Material.Glass
elseif part:IsA("BillboardGui") then
part.Enabled = false
elseif part:IsA("Decal") then
local tween3 = tweenservice:Create(part, tweeninfo, {Transparency = 1})
tween3:Play()
end
end
tween:Play()
local aoe = workspace:GetPartsInPart(sphere)
for i, part in pairs(aoe) do
if part:IsA("BasePart") then
if part.Parent:FindFirstChildOfClass("Humanoid") then
local playur = game.Players:GetPlayerFromCharacter(part.Parent)
if playur ~= nil then
if not table.find(targets, playur.Character) then
for i, k in pairs(part.Parent:GetDescendants()) do
if (k.Name ~= "HumanoidRootPart" and k:IsA("MeshPart") or k:IsA("Part") and k.Name ~= "HumanoidRootPart") then
remote:InvokeClient(playur, 0.7)
elseif k:IsA("BillboardGui") then
k.Enabled = false
end
table.insert(targets, part.Parent)
end
end
else
if not table.find(targets, part.Parent) then
for i, e in pairs(e:GetDescendants()) do
if (e.Name ~= "HumanoidRootPart" and e:IsA("MeshPart") or e:IsA("Part") and e.Name ~= "HumanoidRootPart") then
local tween2 = tweenservice:Create(part, tweeninfo, {Transparency = 1})
tween2:Play()
part.Material = Enum.Material.Glass
elseif e:IsA("BillboardGui") then
e.Enabled = false
elseif part:IsA("Decal") then
local tween3 = tweenservice:Create(part, tweeninfo, {Transparency = 1})
tween3:Play()
end
table.insert(targets, part.Parent)
end
end
end
end
end
end
end
function functions.End(plr)
local tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tweenservice = game:GetService("TweenService")
local chr = plr.Character
local hum = chr:FindFirstChildOfClass("Humanoid")
local health = hum.Health
local sphere = script.Sphere:Clone()
sphere.Parent = workspace.Effects
sphere.Position = chr.HumanoidRootPart.Position
local tween = tweenservice:Create(sphere, tweeninfo, {Size = Vector3.new(38.75, 38.75, 38.75)})
for i, part in pairs(chr:GetDescendants()) do
if (part.Name ~= "HumanoidRootPart" and part:IsA("MeshPart") or part:IsA("Part") and part.Name ~= "HumanoidRootPart") then
local tween2 = tweenservice:Create(part, tweeninfo, {Transparency = 0})
tween2:Play()
part.Material = Enum.Material.SmoothPlastic
elseif part:IsA("BillboardGui") then
part.Enabled = true
elseif part:IsA("Decal") then
local tween3 = tweenservice:Create(part, tweeninfo, {Transparency = 0})
tween3:Play()
end
end
tween:Play()
for i, k in pairs(workspace:GetChildren()) do
if table.find(targets, k) then
for i, part in pairs(k:GetDescendants()) do
local playur = game.Players:GetPlayerFromCharacter(k)
if playur ~= nil then
if (part.Name ~= "HumanoidRootPart" and part:IsA("MeshPart") or part:IsA("Part") and part.Name ~= "HumanoidRootPart") then
remote:InvokeClient(playur, 0)
elseif part:IsA("BillboardGui") then
part.Enabled = true
end
else
if (part.Name ~= "HumanoidRootPart" and part:IsA("MeshPart") or part:IsA("Part") and part.Name ~= "HumanoidRootPart") then
local tween2 = tweenservice:Create(part, tweeninfo, {Transparency = 0})
tween2:Play()
part.Material = Enum.Material.SmoothPlastic
elseif part:IsA("BillboardGui") then
part.Enabled = true
elseif part:IsA("Decal") then
local tween3 = tweenservice:Create(part, tweeninfo, {Transparency = 0})
tween3:Play()
end
end
end
end
end
end
return functions
This is my modulescript.
It gets required by a remote event that gets fired from a localscript.
When I do the ability, it does turn the player’s character invisible on server side and the player’s character’s transparency to 0.5 in client. But it doesn’t do it for npcs or other players.
This is the localscript that’s being used in the tool to fire the remote event and require the module to do the move. Its where I set the player that used the move’s client side invisibility to 0.7. but for other players there’s a invisibility localscript for the client to be invoked.
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local Modules = RS:WaitForChild("Modules")
local Fruit = Modules:WaitForChild("Fruit")
local HM = Modules:WaitForChild("Handlers")
local Tool = script.Parent
local Player = game.Players.LocalPlayer
local remote = RS.RemoteEvents.Fruit
local PlayerGui = Player:WaitForChild("PlayerGui")
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Cooldown1 = false
local Holding1 = false
local Cooldown2 = false
local Holding2 = false
local Debounce = 1
local Mouse = Player:GetMouse()
local track1 = Humanoid:LoadAnimation(Tool.Animations.Spin)
local tweeninfo = TweenInfo.new(1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local ts = game:GetService("TweenService")
local function zmove()
Tool.Active.Value = "Z"
remote:FireServer("Suke", "Self Invisibility", "Start")
wait(2)
for i, v in pairs(Character:GetDescendants()) do
if (v.Name ~= "HumanoidRootPart" and v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart") then
v.Transparency = 0.7
elseif v:IsA("Decal") then
v.Transparency = 0.7
end
end
wait(10)
for i, v in pairs(Character:GetDescendants()) do
if (v.Name ~= "HumanoidRootPart" and v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart") then
v.Transparency = 0
elseif v:IsA("Decal") then
v.Transparency = 0
end
end
remote:FireServer("Suke", "Self Invisibility", "End")
Tool.Active.Value = "None"
end
local function xmove()
Tool.Active.Value = "Z"
remote:FireServer("Suke", "Area Invisibility", "Start")
wait(2)
for i, v in pairs(Character:GetDescendants()) do
if (v.Name ~= "HumanoidRootPart" and v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart") then
v.Transparency = 0.7
elseif v:IsA("Decal") then
v.Transparency = 0.7
end
end
wait(10)
remote:FireServer("Suke", "Self Invisibility", "End")
Tool.Active.Value = "None"
end
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" and Cooldown1 == false then
Debounce = 2
local HIS = Tool.Animations["Area Charge"]
HoldTrack = Player.Character.Humanoid:LoadAnimation(HIS)
HoldTrack:Play()
for i = 1,math.huge do
if Debounce == 2 then
local RootPos, MousePos = Player.Character.HumanoidRootPart.Position, Mouse.Hit.Position
Player.Character.HumanoidRootPart.CFrame = CFrame.new(RootPos, Vector3.new(MousePos.X, RootPos.Y, MousePos.Z))
Player.Character.HumanoidRootPart.Anchored = true
else
break
end
wait()
end
elseif Input.KeyCode == Enum.KeyCode.Z and Tool.Equip.Value == true and Tool.Active.Value == "None" and Cooldown1 == false then
track1:Play()
zmove()
Cooldown1 = true
wait(3)
Cooldown1 = false
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" and Cooldown1 == false then
Cooldown1 = true
Debounce = 3
local PIS = Tool.Animations["Area Release"]
local PunchTrack = Player.Character.Humanoid:LoadAnimation(PIS)
PunchTrack:Play()
HoldTrack:Stop()
PunchTrack:GetMarkerReachedSignal("Release"):Connect(function()
xmove()
task.wait(3)
Cooldown1 = false
end)
wait(1)
Player.Character.HumanoidRootPart.Anchored = false
wait(2)
Tool.Active.Value = "None"
wait(0.1)
Debounce = 1
end
end)
This is the invoke thingy:
local rs = game:GetService("ReplicatedStorage")
local re = rs.RemoteEvents
local invisiblevent = re.Suke.Invisible
invisiblevent.OnClientInvoke = function(transparency)
for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
if (v.Name ~= "HumanoidRootPart" and v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart") then
v.Transparency = transparency
elseif v:IsA("Decal") then
v.Transparency = transparency
end
end
end