com base nesses scripts , modfique para clonar um mesh chamado "Giz" que tem um Motor6d…
- User
com base nesses scripts , modfique para clonar um mesh chamado "Giz" que tem um Motor6d chamado "Rightand" dentro dele, na righthand do player, ao inves de clonar um acessorio. localscript : local player = game.Players.LocalPlayer local TextBox = script.Parent -- Adjust this if the script isn't a direct child of the TextBox
-- Replace "AnimationIDHere" with your actual animation ID local animationId = "rbxassetid://112153289996608" local Animation = Instance.new("Animation") Animation.AnimationId = animationId
-- Variables to manage animation and input local animationTrack local keysPressed = 0 -- Counter for keys currently pressed (PC) local debounce = false local isAnimationPlaying = false
local RunService = game:GetService("RunService") local lastTextChangeTime = nil local typingStopDelay = 0.75 -- Time after which we consider typing has stopped (mobile)
-- RemoteEvent for accessory management local ReplicatedStorage = game:GetService("ReplicatedStorage") local AccessoryEvent = ReplicatedStorage:WaitForChild("AccessoryEvent") local lastAccessoryEventTime = 0 local accessoryEventCooldown = 0.5 -- Send typing notification at most every 0.5 seconds
local function playAnimation() if not isAnimationPlaying then -- Play the animation local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid then animationTrack = humanoid:LoadAnimation(Animation) animationTrack:Play() isAnimationPlaying = true end end end
local function stopAnimation() if isAnimationPlaying and animationTrack then animationTrack:Stop() isAnimationPlaying = false end end
-- Function to handle input began in the TextBox (for PC) local function onInputBegan(input) if input.UserInputType == Enum.UserInputType.Keyboard then keysPressed = keysPressed + 1 if not debounce then debounce = true playAnimation()
code-- Send typing notification to server with cooldown if tick() - lastAccessoryEventTime >= accessoryEventCooldown then AccessoryEvent:FireServer("Typing") lastAccessoryEventTime = tick() end -- Debounce timer of 0.1 seconds task.delay(0.75, function() debounce = false end) end endend
-- Function to handle input ended in the TextBox (for PC) local function onInputEnded(input) if input.UserInputType == Enum.UserInputType.Keyboard then keysPressed = math.max(keysPressed - 1, 0) if keysPressed == 0 then stopAnimation() end end end
-- Connect for keyboard input in the TextBox (for PC) TextBox.InputBegan:Connect(onInputBegan) TextBox.InputEnded:Connect(onInputEnded)
- Assistant