Hello, so i wanted to start a Jojo Bizarre Adventure game and i have scripted so that whenever you press q a stand will come out and if you press q while you have it out it will go back but instead of that it is just coming more and more.Any help?
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local summon = rp:WaitForChild("Summon")
local UIS = game:GetService("UserInputService")
local isActive = false
local debounce = false
local cd = 1
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.Q then
if debounce == false and isActive == false then
isActive = true
debounce = true
summon:FireServer(isActive)
wait(cd)
debounce = false
elseif debounce == false and isActive == true then
isActive = false
debounce = true
summon:FireServer(isActive)
wait(cd)
debounce = false
end
end
end)
and this:
local rp = game:GetService("ReplicatedStorage")
local summon = rp:WaitForChild("Summon")
local TweenService = game:GetService("TweenService")
summon.OnServerEvent:Connect(function(Player,isActive)
local Character = Player.Character
local Humanoid = Player:FindFirstChild("Humanoid")
local Humrp = Character.HumanoidRootPart
if isActive then
local Stand = script:WaitForChild("Stand"):Clone()
Stand.Parent = Character
Stand.PrimaryPart.CFrame = Humrp.CFrame
local weld = Instance.new("ManualWeld")
weld.Part0 = Stand.PrimaryPart
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local AnimControl = Stand:FindFirstChild("AnimControl")
local Idle = AnimControl:LoadAnimation(script.Idle)
Idle:Play()
local goal = {}
goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3,1,2))
local info = TweenInfo.new(.5)
local tween = TweenService:Create(weld,info,goal)
tween:Play()
else
end
end)

3 comments
show the script
Yea
done