why is this a resource if this dosent benefit you anyway?
Still, lollllll I can now tell my enemies to download this XD
Edit : They actually installed it and got rekt omg omg make more insults
suggestion: whenever you make a build, the guy will harrass you for an ugly build
suggestion 2: (it can be disabled or enabled) if you close the widget, it will automatically open itself loll and will make the guy much more angry, example
widget:GetPropertyChangedSignal("Enabled"):Connect(function()
if widget.Enabled == false then
widget.Enabled = true
-- make him more angry logic
end
end)
You should make them do emotes when they insult you. I wanted to do something similar last night but couldnāt figure it out because animations decided they didnāt want to work when studio wasnāt running but I was determined and found a way.
behold lost sanity code
-- Gui:
local gui = Instance.new("ScreenGui");
gui.Parent = game:GetService("CoreGui");
gui.Name = "PlayerViewport";
local viewport = Instance.new("ViewportFrame");
viewport.Size = UDim2.fromOffset(200,300);
viewport.Parent = gui;
viewport.BorderSizePixel = 0;
viewport.BackgroundTransparency = 1;
-- Variables:
local runService = game:GetService("RunService");
local players = game:GetService("Players");
local sequenceProvider = game:GetService("KeyframeSequenceProvider");
local isRunning = runService:IsRunning();
local heartbeat = runService.Heartbeat;
local lastAnimation;
local lastAnimationObject;
local track;
local offset = CFrame.new(0,2.5,-7); --> viewport offset
local dummyObject = "rbxassetid://8285928387"; --> dummy for the viewport base
-- One of the issues with studio in the non-running state is that the animator
-- doesn't update in live time so I have to make this complicated function to ensure it works
-- properly in studio while editing instead of being live
-- Reference: https://developer.roblox.com/en-us/api-reference/function/Animator/StepAnimations
local animateInStudio = function(model,animationId,looped)
-- This will allow you to load animations you don't own for more variety per say
local rawAnimation = game:GetObjects(animationId)[1];
local hashId = sequenceProvider:RegisterKeyframeSequence(rawAnimation);
local animation = Instance.new("Animation");
animation.AnimationId = hashId;
lastAnimationObject = animation;
local animationController = model:FindFirstChildOfClass("Humanoid") or model:FindFirstChildOfClass("AnimationController");
local animator = animationController and animationController:FindFirstChildOfClass("Animator");
local doEnd = false;
if(not animator) then
animator = Instance.new("Animator");
animator.Parent = animationController;
end
pcall(function()
track:Stop();
end)
if(not isRunning) then
local stop = function(track)
track:Stop(0);
animator:StepAnimations(0);
for _,descendant in pairs(model:GetDescendants()) do
if(descendant:IsA("Motor6D")) then
local joint = descendant;
joint.CurrentAngle = 0;
joint.Transform = CFrame.new();
end
end
end
local run = function()
local success,response = pcall(function()
track = animationController:LoadAnimation(animation);
track:Play();
end)
if(not success) then
doEnd = true;
return;
end
local startTime = tick();
local key = tick();
lastAnimation = key;
while((tick() - startTime) <= track.Length and lastAnimation == key) do
local step = heartbeat:Wait()
local success,response = pcall(function()
animator:StepAnimations(step)
end)
if(not success) then
lastAnimation = nil;
doEnd = true;
break;
end
end
if(lastAnimation == key) then
if(not looped) then
stop(track);
end
end
return track;
end
if(looped) then
coroutine.wrap(function()
while(true and lastAnimationObject == animation and not doEnd) do
run();
end
end)();
else
coroutine.wrap(function()
stop(run());
end)();
end
elseif(isRunning) then
track = animationController:LoadAnimation(animation);
track.Looped = (looped == true);
track:Play();
end
end
-- Reference: https://devforum.roblox.com/t/easy-way-to-put-accessories-on-a-rig-thats-in-a-viewport-frame/297941/2
local attachAccessory = function(character,accessory)
local attachment = accessory.Handle:FindFirstChildOfClass("Attachment");
local weld = Instance.new("Weld");
weld.Name = "AccessoryWeld";
weld.Part0 = accessory.Handle;
if(attachment ~= nil) then
local other = character:FindFirstChild(attachment.Name,true);
weld.C0 = attachment.CFrame;
weld.C1 = other.CFrame;
weld.Part1 = other.Parent;
else
weld.C1 = CFrame.new(0,character.Head.Size.Y / 2,0) * accessory.AttachmentPoint:inverse();
weld.Part1 = character.Head;
end
accessory.Handle.CFrame = weld.Part1.CFrame * weld.C1 * weld.C0:inverse();
accessory.Parent = character;
weld.Parent = accessory.Handle;
end
local loadCharacter = function(userId)
local dummy = game:GetObjects(dummyObject)[1];
dummy.Parent = workspace;
dummy.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None;
coroutine.wrap(function()
local description = players:GetHumanoidDescriptionFromUserId(userId);
dummy.Humanoid:ApplyDescription(description);
for _,object in pairs(dummy:GetChildren()) do
if(object:IsA("Accessory")) then
attachAccessory(dummy,object);
end
end
dummy:SetAttribute("Loaded",true);
end)();
return dummy;
end
-- Reference: https://devforum.roblox.com/t/rendering-the-character-with-a-viewportframe/241369/31
local getCameraPosition = function(character)
return CFrame.new(character.HumanoidRootPart.CFrame:ToWorldSpace(offset).Position,character.HumanoidRootPart.Position);
end
local loadCharacterIntoViewport = function(userId)
for _,old in pairs(viewport:GetChildren()) do
old:Destroy();
end
local character = loadCharacter(userId);
local worldModel = Instance.new("WorldModel");
worldModel.Parent = viewport;
local camera = Instance.new("Camera");
camera.Parent = worldModel;
viewport.CurrentCamera = camera;
character.Parent = worldModel;
camera.CFrame = getCameraPosition(character);
local signal;
signal = character.AttributeChanged:Connect(function()
signal:Disconnect();
camera.CFrame = getCameraPosition(character);
end)
return character;
end
-- Usage:
local char = loadCharacterIntoViewport(87424828);
animateInStudio(char,"rbxassetid://8286027176",true)
I had too much free time on my hands and the fact animations donāt work when the game isnāt running bothered me so I hyperfocused on the wrong thing for 30 minutes
Edit to your reply:
Itās not custom persay, and I donāt think thereās any performance implications because itās a direct method, see here:
Also Iāll probably be using that code for something stupid in the future, thatās another reason I wrote it.
I scripted it according to your suggestion but one thing I didnāt realize was when you run the game the plugin is basically run twice once on the client and once on the server. Iām gonna have to make some sort of way for them to communicate in order for the script errors to show up for both client and serverā¦
The issue with this is that it could interrupt developerās testing experiences because I wouldnāt be able to put the remote in the same place as the plugin