Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- To those scripting folk out there:
- This puts a value in the player's character so the script can figure out what to do.
- It's a little bit pointless, but hey, it works.
- From there, the script clones the head, puts it in a model inside the Character, welds it on,
- and renames it. Good to go.
- -madscientist42
- ]]--
- function onChatted(message, player)
- if message:sub(1, 5) == "Name/" or message:sub(1, 5) == "name/" then -- if first part of message is name/ then
- local hi = player.Character
- local humanoid = hi.Humanoid
- if hi:FindFirstChild("Custom") == nil then
- local val = Instance.new("BoolValue") -- add the semi-pointless value if it doesnt already exist.
- val.Name = "Custom"
- val.Parent = hi
- val.Value = false
- end
- local maybe = hi:FindFirstChild("Custom")
- if maybe ~= nil then
- if maybe.Value == true then
- local stoof = hi:GetChildren()
- for i = 1,#stoof do
- if stoof[i]:IsA("Model") then
- stoof[i].Name = (message:sub(6))
- end
- end
- end
- if maybe.Value == false then
- local c = humanoid.Parent.Head:Clone()
- local m = Instance.new("Model")
- local h = Instance.new("Humanoid")
- humanoid.Parent.Head.Transparency = 1 -- invisible your real head.
- h.Name = "Herpdederp" -- to eliminate the potential for zombie-like scripts to attack the fake head
- h.MaxHealth = 0
- h.Health = 0 -- no healthbar.
- m.Parent = hi
- h.Parent = m
- c.Parent = m
- m.Name = (message:sub(6)) -- set the name to whatever you said
- local weld = Instance.new("Weld") --weld the head on
- weld.Parent = humanoid.Parent.Head
- weld.Part0 = humanoid.Parent.Head
- weld.Part1 = c
- maybe.Value = true
- end
- end
- end
- end
- game.Players.PlayerAdded:connect(function(player)
- player.Chatted:connect(function(message) onChatted(message, player) end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement