when i click test button it will need to test it on the normal character
heres the example:
KillEffect Handler:
local ts = game:GetService("TweenService")
local fadeTI = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local particlesTI = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local rs = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
task.wait()
local humanoid = char:WaitForChild("Humanoid")
humanoid.BreakJointsOnDeath = false
char.Parent = game.Workspace.Chars
end)
end)
game:GetService("Players").PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local PlrGui = plr.PlayerGui
rs.Events.BindableEvents.KillEffect.Event:Connect(function(target)
local chr = target.Parent
local humanoid = chr:WaitForChild("Humanoid")
local frozen = rs.Storage.KillEffects.Froze.Snow.Attachment:Clone()
local cube = rs.Storage.KillEffects.Froze.IceCube:Clone()
local burst = rs.Storage.KillEffects.burst:Clone()
--//Effects//--
local function SnowEffect()
local p = chr:GetDescendants()
for _, char2 in ipairs(p) do
if char2:IsA("BasePart") then
char2.Anchored = true
ts:Create(char2, fadeTI, {Color = Color3.new(0.27451, 0.65098, 0.827451)}):Play()
end
if char2:IsA("Shirt") or char2:IsA("Pants") then
ts:Create(char2, fadeTI, {Color3 = Color3.new(0.27451, 0.65098, 0.827451)}):Play()
end
ts:Create(chr:WaitForChild("Torso"), fadeTI, {Color = Color3.new(0.27451, 0.65098, 0.827451)}):Play()
end
frozen.Parent = chr.HumanoidRootPart
cube.Parent = workspace.Trash
cube.Position = chr:WaitForChild("HumanoidRootPart").Position
wait(5)
cube:Destroy()
end
local function ghost()
local p = chr:GetDescendants()
for _, char2 in ipairs(p) do
if char2:IsA("BasePart") then
char2.Anchored = false
ts:Create(char2, fadeTI, {Position = burst.Position}):Play()
end
ts:Create(chr:WaitForChild("Torso"), fadeTI, {Position = burst.Position}):Play()
end
burst.Parent = workspace.Trash
burst.Position = chr:WaitForChild("HumanoidRootPart").Position * Vector3.new(0, 5, 0)
wait(5)
burst:Destroy()
end
SnowEffect()
--//END//--
if chr.Name == char.Name then
rs.Events.RemoteEvents["Disableİnv"]:FireAllClients(false)
humanoid:UnequipTools()
wait(3)
plr:LoadCharacter()
rs.Events.RemoteEvents["Enbaleİnv"]:FireAllClients(false)
end
end)
end)
test script
local rs = game:GetService("ReplicatedStorage")
game:GetService("Players").PlayerAdded:Connect(function(plr)
local plrGui = plr.PlayerGui
local shop = plrGui:WaitForChild("Shop").Frame
local try = shop.ScrollingFrame.froze.try
local try2 = shop.ScrollingFrame.froze.try2
local dummy = shop.ScrollingFrame.froze.WorldModel.Expination.Humanoid
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
try.MouseButton1Click:Connect(function()
rs.Events.BindableEvents.KillEffect:Fire(hum)
end)
try2.MouseButton1Click:Connect(function()
rs.Events.BindableEvents.KillEffect:Fire(dummy)
end)
end)
end)