I’ve been trying for hours trying to figure out how to freeze the player and tween it’s position up into the lava to kill the player. The client side seems fine, but the server side is wonky which I believe this is the reason why the player isn’t dying. I’ve tried to find solutions to this problem which I found a similar question on the DevForum.
His question was never answered. Anyways, I will leave videos below of both the client and server sides and the code block will be below.
~
~ CLIENT
~
~ SERVER
~
~ CODE
local awesomeness = script.Parent
local tween = game:GetService("TweenService")
awesomeness.Touched:Connect(function(bob)
local johnny = bob.Parent
local humanoid = johnny:FindFirstChild("Humanoid")
if humanoid then
local head = humanoid.Parent:FindFirstChild("HumanoidRootPart")
head.Anchored = true
local guy = TweenInfo.new(
5, -- time
Enum.EasingStyle.Quad, -- how it transitions
Enum.EasingDirection.InOut, -- how the values speed up or slow down
-1,
false,
0.01
)
local coolness = tween:Create(head, guy, {Position = head.Position + Vector3.new(0, 40, 0)})
coolness:Play()
end
end)
Thanks for anyone who helps! I’ve been using the forums recently lol.
I see! I changed that and added a unanchored line of code near the end and it solved my problems.
local awesomeness = script.Parent
local tween = game:GetService("TweenService")
awesomeness.Touched:Connect(function(bob)
local johnny = bob.Parent
local humanoid = johnny:FindFirstChild("Humanoid")
if humanoid then
local head = humanoid.Parent:FindFirstChild("HumanoidRootPart")
head.Anchored = true
local guy = TweenInfo.new(
5, -- time
Enum.EasingStyle.Quad, -- how it transitions
Enum.EasingDirection.InOut, -- how the values speed up or slow down
0,
false,
0.01
)
local coolness = tween:Create(head, guy, {CFrame = head.CFrame + Vector3.new(0, 38, 0)})
coolness:Play()
wait(5)
head.Anchored = false
end
end)