So recently I’ve been trying to make QuickTimeEvent, where the player who presses the button fastest wins. The QTE itself is working but the problem is that the script on the serverside does not work. It fires the remote events and all that but it does not print out anything and it also doesn’t damage the players who have lost the QTE. When testing it on studio it works but it doesn’t work when for example teamtesting it.
Here is the local script:
local Remote = game.ReplicatedStorage.StartCountdown
local StartQuick = game.ReplicatedStorage.Quicktime.Start
local TriggerQuick = game.ReplicatedStorage.Quicktime.Trigger
local EndQuick = game.ReplicatedStorage.Quicktime.End
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local QuickGui = script.Parent.Parent.QuickTime
Character:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.Physics)
Label.Text = "Waiting For Players..."
Remote.OnClientEvent:Wait()
Label.Size = UDim2.new()
Label:TweenSize(UDim2.new(0.3,0,0.3,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.2)
Label.Text = "3"
wait(1)
Label.Size = UDim2.new()
Label:TweenSize(UDim2.new(0.3,0,0.3,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.2)
Label.Text = "2"
wait(1)
Label.Size = UDim2.new()
Label:TweenSize(UDim2.new(0.3,0,0.3,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.2)
Label.Text = "1"
wait(1)
Label.Size = UDim2.new()
Label:TweenSize(UDim2.new(1,0,0.3,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.2)
Label.Text = "Fight!"
Label:TweenPosition(UDim2.new(0.5, 0, -1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Back, 0.5)
wait(0.5)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Running)
StartQuick.OnClientEvent:Wait()
local Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
local RandomNum = math.random(1, #Letters)
local RandomLetter = string.sub(Letters, RandomNum, RandomNum)
QuickGui.Visible = true
QuickGui.Key.Letter.Text = RandomLetter
print(RandomLetter)
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
repeat wait() until UIS:IsKeyDown(Enum.KeyCode[RandomLetter])
TriggerQuick:FireServer()
won = EndQuick.OnClientEvent:Wait()
print("LOCAL: "..won.. " Won the Quicktime")
Character.Humanoid:ChangeState(Enum.HumanoidStateType.Running)
Here is the server script:
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("StartCountdown")
print("do something pls ;-;")
repeat wait() until #game.Players:GetPlayers() > 0
wait(25)
print("25 Seconds!")
Remote:FireAllClients()
print("Countdown Started!")
print("15 Seconds!")
wait(15)
print("QUICKTIME STARTED")
game:GetService("ReplicatedStorage"):WaitForChild("Quicktime"):WaitForChild("Start"):FireAllClients()
local Player = game:GetService("ReplicatedStorage"):WaitForChild("Quicktime"):WaitForChild("Trigger").OnServerEvent:Wait()
print("QUICKTIME TRIGGERED")
print("YES ".. Player.Name.. " WON!")
for i, v in pairs(game.Players:GetPlayers()) do
if not v.Name == Player.Name then
v.Character.Humanoid.Health = 0
end
end
game:GetService("ReplicatedStorage"):WaitForChild("Quicktime"):WaitForChild("End"):FireAllClients(Player.Name)
print("ENDED QUICKTIME")
I don’t really know why it does not work, since there is no apparently no error.
Thank you for your help in advance!