I tried using print and the print appears when the local script fire the server but not in the event, im not sure what the problem is.
local script:
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local uis = game:GetService("UserInputService")
local debounce = 1
local summoned = false
local stand = plr:WaitForChild("Stand")
uis.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.Q and debounce == 1 and summoned == false and plr:WaitForChild("Stand").Value ~= "None" then
debounce = 2
game.ReplicatedStorage.Stands:WaitForChild(stand.Value).Events.Summon:FireServer("Summon")
print("yep")
--local playanim = char:WaitForChild("Stand"):WaitForChild("AnimationController"):LoadAnimation(game.ReplicatedStorage:WaitForChild("Stands"):WaitForChild(stand.Value):WaitForChild("Animation"):WaitForChild("Idle"))
--playanim:Play()
wait(1.5)
summoned = true
end
end)
uis.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.Q and debounce == 2 and summoned == true then
debounce = 3
game.ReplicatedStorage.Stands:WaitForChild(stand.Value).Events.Summon:FireServer("Unsummon")
wait(1.5)
summoned = false
debounce = 1
end
end)
Server Script:
local tween = game:GetService("TweenService")
script.Parent.Parent.Events.Summon.OnServerEvent:Connect(function(plr, task)
local char = plr.Character or plr.CharacterAdded:Wait()
local standvalue = plr:WaitForChild("Stand")
if task == "Summon" then
print("yep again")
local gui = script.Parent.Parent.Cooldowns:WaitForChild("Summon")
gui:WaitForChild("LocalScript").Disabled = false
gui.Parent = plr.PlayerGui
local x = script.Parent.Parent:WaitForChild(standvalue.Value):Clone()
script.Parent.Parent.Events:WaitForChild("Summon"):FireClient(plr)
local bP = {
"Head",
"UpperTorso",
"LowerTorso",
"LeftUpperArm",
"LeftLowerArm",
"LeftHand",
"RightUpperArm",
"RightLowerArm",
"RightHand",
"LeftUpperLeg",
"LeftLowerLeg",
"LeftFoot",
"RightUpperLeg",
"RightLowerLeg",
"RightFoot",
"face"
}
for i, v in pairs(x:GetChildren()) do
for i2, v2 in pairs(bP) do
if v.Name == v2 then
v.Transparency = 1
end
end
end
local info = TweenInfo.new(0.7) -- Summon speed
local goal = {C0 = CFrame.new(2, 1, 2)}
local goal2 = {Transparency = 0}
local info2 = TweenInfo.new(0.4) -- transparency speed
local weld = Instance.new("Weld")
weld.Part0 = char:WaitForChild("HumanoidRootPart")
weld.Part1 = x:WaitForChild("HumanoidRootPart")
weld.Parent = x:WaitForChild("HumanoidRootPart")
x.Name = "Stand"
local tweenthing = tween:Create(weld, info, goal)
tweenthing:Play()
for i, v in pairs(x:GetChildren()) do
for i2, v2 in pairs(bP) do
if v.Name == v2 then
local tweenthing2 = tween:Create(v, info2, goal2)
tweenthing2:Play()
end
end
end
x.Parent = char
wait(1)
plr:WaitForChild("Summoned").Value = true
elseif task == "Unsummon" then
local gui = game.ReplicatedStorage:WaitForChild("Stands"):WaitForChild(standvalue.Value):WaitForChild("Cooldowns"):WaitForChild("Summon"):Clone()
gui:WaitForChild("LocalScript").Disabled = false
gui.Parent = plr.PlayerGui
script.Parent.Parent.Events:WaitForChild("Summon"):FireClient(plr)
plr:WaitForChild("Summoned").Value = false
local x = char:WaitForChild("Stand")
if x then
local bP = {
"Head",
"UpperTorso",
"LowerTorso",
"LeftUpperArm",
"LeftLowerArm",
"LeftHand",
"RightUpperArm",
"RightLowerArm",
"RightHand",
"LeftUpperLeg",
"LeftLowerLeg",
"LeftFoot",
"RightUpperLeg",
"RightLowerLeg",
"RightFoot"
}
local weld = x:WaitForChild("HumanoidRootPart"):WaitForChild("Weld")
local goal = {C0 = CFrame.new(0, 0, 0)}
local goal2 = {Transparency = 1}
local info = TweenInfo.new(0.7) -- Summon speed
local info2 = TweenInfo.new(0.4) -- transparency speed
local tweenthing = tween:Create(weld, info, goal)
tweenthing:Play()
for i, v in pairs(x:GetChildren()) do
for i2, v2 in pairs(bP) do
if v.Name == v2 then
local tweenthing2 = tween:Create(v, info2, goal2)
tweenthing2:Play()
end
end
end
wait(0.5)
x:Destroy()
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local summoned = Instance.new("BoolValue", plr)
summoned.Name = "Summoned"
summoned.Value = false
end)
end)
