Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does this part teleport to the world origin and not the players humanoidrootpart?

I suspect line 22, I made sure to add a "WaitForChild" for the "player" Variable

local player = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
local icepart = game.Workspace:WaitForChild("IcePart")
local debounce = false
game.ReplicatedStorage.TouchTalk20.OnClientEvent:Connect(function()
	if debounce then return end
	debounce = true
	game.Workspace.Music.SoundId = "rbxassetid://4479420810"
	  
function Freeze(player, bool)
    local char = player.Character
    local hum = char:FindFirstChildOfClass("Humanoid")
    for i,v in pairs(char:GetChildren()) do
        if v:IsA("BasePart") then
            v.Anchored = bool
        end
    end
    hum.PlatformStand = bool
end
wait (2)
Freeze(game:GetService("Players").LocalPlayer, true)
	   icepart.Transparency = 0.3
	  icepart.Position = Vector3.new(player.Head) 
	
	script.Parent.Visible = true

sentences = {
    "So you.. Made it over to me.",
    "I drank the acid.. I thought.. I thought it would make people feel bad..",
		    "Make people acknowledge me.",
		"That is why I am on the ground like this.",
		"A few seconds ago.. I was talking all big, Haha.. Hahaha.",
		"I am so pathetic. Alright.. I will.. Tell you everything I know *pant* *cough*",
		"I don't have much time, that acid in my factory will over flood, I turned the sewer gates off.",
		"I did this, because.. No one cared I existed.. No one.",
		"I wanted a reason to.. To make everyone depend on my decisions.",
		"That reason was murdering everyone with acid, huh?",
		"The person that told everyone to ignore me was.. Pip... *cough*",
		"It doesn't matter... Not anymore.. But what I thought was weird was I saw a girl in the sewers.",
		"That's not the point.. I want to tell you something.",
		"I found this riddle, This is what it said in the mother of gods, In the place of rats, Lies a human of weird intentions.",
		"*cough* *cough* Go now... I will stay.. I have something to do.."
}



function displaySentence(sentence)
    for i = 1, #sentence do
        script.Parent.Text = string.sub(sentence, 1, i)
        wait(0.09) 
    end
end



for _, sentence in pairs(sentences) do
    displaySentence(sentence)
    wait(1)
end
	script.Parent.Visible = false
	game.Workspace.Inviswall1.CanCollide = false
	game.Workspace.WallBlock1.Transparency = 1
	game.Workspace.WallBlock1.CanCollide = false
    game.Workspace.Music.SoundId = "rbxassetid://1842762177"
	
end)

6 comments

0

that is an intense story line...!

0

Thanks man, lmao

0

remove the .Name on line 1

0

and its player.Character.Head

0

Just made the script not work at all

0

How about those 'character:FindFirstChildWhichIsA("Humanoid")'?

1 answer

Vector3.new() at line 22 expects x,y,z. This should be solved by doing

icepart.Position = player.Head.Position

or

icepart.Position = Vector3.new(player.Head.Position.X,player.Head.Position.Y,player.Head.Position.Z)

This discussion is preserved as it was. New answers, comments, and votes are closed.