Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WORKS ONLY IN R6 SCRIPT VERY OLD!
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- LocalScript3 = Instance.new("LocalScript")
- LocalScript4 = Instance.new("LocalScript")
- Animation5 = Instance.new("Animation")
- LocalScript6 = Instance.new("LocalScript")
- Tool0.Name = "FreakyFridayPotion"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=78673347"
- Tool0.GripForward = Vector3.new(-0, 1, -0)
- Tool0.GripPos = Vector3.new(0.150000006, -0.150000006, -0.5)
- Tool0.GripUp = Vector3.new(-0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Bright bluish green")
- Part1.Rotation = Vector3.new(-90, 0, 0)
- Part1.Locked = true
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(0.659999907, 0.80000025, 1.62999988)
- Part1.CFrame = CFrame.new(-15.3299999, 0.814999938, 4.5999999, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- Part1.Color = Color3.new(0, 0.560784, 0.611765)
- Part1.Position = Vector3.new(-15.3299999, 0.814999938, 4.5999999)
- Part1.Orientation = Vector3.new(-90, 0, 0)
- Part1.Color = Color3.new(0, 0.560784, 0.611765)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=78673311"
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=78673334"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- LocalScript3.Name = "Local Gui"
- LocalScript3.Parent = Tool0
- table.insert(cors,sandbox(LocalScript3,function()
- local Tool = script.Parent;
- local stillEquipped = true
- function onEquippedLocal(mouse)
- stillEquipped = true
- if mouse == nil then
- print("Mouse not found")
- return
- end
- while stillEquipped do
- print("Setting Mouse to Go")
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- while Tool.Enabled and stillEquipped do
- wait(.01)
- end
- print("Setting Mouse To Wait")
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- while not Tool.Enabled and stillEquipped do
- wait(.01)
- end
- end
- end
- function onUnequippedLocal()
- stillEquipped = false
- end
- Tool.Equipped:connect(onEquippedLocal)
- Tool.Unequipped:connect(onUnequippedLocal)
- end))
- LocalScript4.Name = "FridayScript"
- LocalScript4.Parent = Tool0
- table.insert(cors,sandbox(LocalScript4,function()
- --[[
- // Don't forget to add helper GUI stuff
- ]]
- local Tool = script.Parent
- local Potion = Tool.Handle
- Tool.Enabled = true
- local vCharacter
- local vTorso
- local vHumanoid
- local vPlayer
- local OtherPlayer = nil
- local OtherCharacter = nil
- local OtherHumanoid
- local OtherTorso
- local SwapSound = nil
- local SwapAnim
- local OtherSwapAnim
- local RBX_Debris = game:GetService("Debris")
- local Mouse = nil
- game.Players.LocalPlayer.Character.Archivable = true
- local Clone = game.Players.LocalPlayer.Character:Clone()
- local cChildren = Clone:GetChildren()
- for i = 1, #cChildren do
- if cChildren[i]:IsA("Script") then
- cChildren[i]:Destroy()
- end
- end
- local Clone2 = Clone:Clone()
- local function spawnClone(character, torso, clone)
- if character and torso and clone then
- local thisClone = clone:Clone()
- thisClone.Name = character.Name
- local target = thisClone:FindFirstChild("Target")
- if target then
- target.Value = character:FindFirstChild("Humanoid")
- else
- target = Instance.new("ObjectValue")
- target.Name = "Target"
- target.Parent = thisClone
- target.Value = character:FindFirstChild("Humanoid")
- end
- thisClone:MoveTo(torso.Position + Vector3.new(5, 0, 5))
- return thisClone
- end
- end
- local function dressClone(character, clone)
- if character then
- local children = character:GetChildren()
- for i = 1, #children do
- if children[i] then
- if children[i].ClassName == "Hat" then
- -- Special
- local hat = Instance.new("Hat")
- local Hpart = children[i].Handle:clone()
- Hpart.Parent = hat
- Hpart.Position = clone.Head.Position
- hat.Name = children[i].Name
- hat.Parent = clone
- hat.AttachmentPos = children[i].AttachmentPos
- hat.AttachmentRight = children[i].AttachmentRight
- hat.AttachmentUp = children[i].AttachmentUp
- hat.AttachmentForward = children[i].AttachmentForward
- elseif children[i]:IsA("BasePart") then
- if clone:FindFirstChild(children[i].Name) and clone[children[i].Name]:IsA("BasePart") then
- clone[children[i].Name].BrickColor = children[i].BrickColor
- end
- elseif children[i].ClassName == "ForceField" or children[i]:IsA("Humanoid") then
- -- Ignore it
- else
- children[i]:Clone().Parent = clone
- end
- end
- end
- return clone
- end
- end
- local function onActivated()
- if Tool.Enabled == false then
- return
- end
- if not vTorso or not vHumanoid then
- return
- end
- local target = Mouse.Target
- if target and target.Parent then
- print(target)
- local humanoid = target.Parent:FindFirstChild("Humanoid")
- if target.Parent:IsA("Hat") and target.Parent.Parent then
- humanoid = target.Parent.Parent:FindFirstChild("Humanoid")
- end
- if humanoid then
- OtherPlayer = game.Players:GetPlayerFromCharacter(humanoid.Parent)
- OtherHumanoid = humanoid
- OtherTorso = OtherPlayer.Character:FindFirstChild("Torso")
- end
- if OtherPlayer and OtherHumanoid and OtherTorso then
- local cf1 = vTorso.CFrame
- local cf2 = OtherTorso.CFrame
- print(cf1.p, cf2.p)
- OtherCharacter = OtherHumanoid.Parent
- SwapAnim = vHumanoid:LoadAnimation(Tool.SwapAnim)
- if SwapAnim then SwapAnim:Play() end
- OtherSwapAnim = OtherHumanoid:LoadAnimation(Tool.SwapAnim)
- if OtherSwapAnim then OtherSwapAnim:Play() end
- vHumanoid.WalkSpeed = 0.0
- OtherHumanoid.WalkSpeed = 0.0
- wait(2.0)
- SwapSound = Tool:FindFirstChild("SwapSound")
- if SwapSound then SwapSound:Play() end
- vHumanoid.WalkSpeed = 16.0
- OtherHumanoid.WalkSpeed = 16.0
- local c = spawnClone(vCharacter, vTorso, Clone)
- local c1 = spawnClone(OtherCharacter, OtherTorso, Clone)
- c1 = dressClone(vCharacter, c1)
- c = dressClone(OtherCharacter, c)
- vPlayer.Character = c
- OtherPlayer.Character = c1
- vPlayer.Character.Parent = game.Workspace
- vPlayer.Character.Torso.CFrame = cf2
- OtherPlayer.Character.Parent = game.Workspace
- OtherPlayer.Character.Torso.CFrame = cf1
- end
- end
- end
- local function onEquipped(mouse)
- vCharacter = Tool.Parent
- vTorso = vCharacter:FindFirstChild("Torso")
- vHumanoid = vCharacter:FindFirstChild("Humanoid")
- vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
- Mouse = mouse
- end
- local function onUnequipped()
- if SwapSound then SwapSound:Stop() end
- if SwapAnim then SwapAnim:Stop() end
- if OtherSwapAnim then OtherSwapAnim:Stop() end
- if vHumanoid then vHumanoid.WalkSpeed = 16.0 end
- if OtherHumanoid then OtherHumanoid.WalkSpeed = 16.0 end
- end
- Tool.Equipped:connect(onEquipped)
- Tool.Activated:connect(onActivated)
- Tool.Unequipped:connect(onUnequipped)
- end))
- Animation5.Name = "SwapAnim"
- Animation5.Parent = Tool0
- Animation5.AnimationId = "http://www.roblox.com/Asset?ID=78674033"
- LocalScript6.Name = "GuiScript"
- LocalScript6.Parent = Tool0
- table.insert(cors,sandbox(LocalScript6,function()
- local Tool = script.Parent
- local Lantern = Tool.Handle
- local vCharacter
- local vPlayer
- local genericTextLabel
- local sg
- local frame
- function onEquipped()
- vCharacter = Tool.Parent
- vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
- if vPlayer then
- local playerGui = vPlayer:FindFirstChild("PlayerGui")
- if playerGui and playerGui:FindFirstChild("LanternGui") == nil then
- sg = Instance.new("ScreenGui")
- sg.Name = "LanternGui"
- sg.Parent = playerGui
- frame = Instance.new("Frame")
- frame.Parent = sg
- frame.Size = UDim2.new(0, 240, 0, 30)
- frame.Position = UDim2.new(0.5, -120, 1, -130)
- frame.Style = Enum.FrameStyle.RobloxRound
- genericTextLabel = Instance.new("TextLabel")
- genericTextLabel.BackgroundTransparency = 1.0
- genericTextLabel.Size = UDim2.new(1, 0, 1, 0)
- genericTextLabel.Visible = true
- genericTextLabel.ZIndex = 10
- genericTextLabel.FontSize = Enum.FontSize.Size10
- genericTextLabel.Font = Enum.Font.Legacy
- genericTextLabel.TextColor3 = Color3.new(1, 127/255, 0)
- genericTextLabel.TextXAlignment = Enum.TextXAlignment.Center
- genericTextLabel.TextYAlignment = Enum.TextYAlignment.Top
- genericTextLabel.Parent = frame
- genericTextLabel.Text = "Click on someone to swap bodies!!"
- end
- end
- end
- function onUnequipped()
- if sg then sg:Remove() end
- end
- Tool.Equipped:connect(onEquipped)
- Tool.Unequipped:connect(onUnequipped)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- Tool0.Parent = game.Players.LocalPlayer.Backpack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement