I am new to learning how to use remote events, and if I can have some help figuring this out that would be nice. If it is not possible I can just see if I can find forum help to just write said kicking script without a remote event, I can answer any question about where the event is and whatno
So what exactly is the problem? Are you having trouble using the remote event or having trouble making a system that will detect if a player hasn’t clicked a part within a set amount of time?
I am having trouble making a working script that kicks the player if a part is not clicked
So is the remote event not relevant or do you need help creating a remote event?
I just need help making a no click to kick script, the remote event is kinda like a thing that could help with that but i dont know for sure if it would
I don’t think you actually need to use a remote event to carry out this action. You could have this in your game with only a server script.
Okay, but the main problem is I don’t really know the code needed : /
that was the main issue of this post
You could model the script after something like this:
> local clickDetector = game.Workspace.Part:WaitForChild("ClickDetector")
local playerSafe = false
clickDetector.MouseClick:Connect(function()
playerSafe = true
end)
wait(30) --waits 30 seconds
for _, player in pairs(game.Players:GetChildren()) do -- kicks all players
if playerSafe == true then
-- rest of the game
else
player:Kick("No one clicked the button")
end
end
This is just an example of how this type of thing would be possible.
Sorry it took so long, but the script still kicks the player even if the part is clicked, any help with that?
Based on the sample of code I gave you (and assuming you have it in your game right), it shouldn’t ban you if the button was pressed.
this is my code for what happens mixed with what you messaged
local switchOff = workspace.LightSwitch.SwitchOff
local light = workspace.CeilingLight.LightPart
local door = workspace.Doorway.InsideDoor.Union
local creak = workspace.Sound
local steps = workspace.Sound2
local breathing = workspace.Sound3
local scratch = workspace.Sound6
local lightThing = workspace.CeilingLight.Thing1
local lightThing2 = workspace.CeilingLight.Thing2
local mirrorCover = workspace.MirrorCover
local AHHHH = workspace.Sound7
local flashlight = workspace.Flashlight
local vent = game.Workspace.Vent
script.Parent.ClickDetector.MouseClick:Connect(function()
local clickDetector = -
game.Workspace.Doorway.InsideDoor.Union:WaitForChild("ClickDetector")
local playerSafe = false
clickDetector.MouseClick:Connect(function()
playerSafe = true
end)
workspace.Sound7.Playing = true
light.SpotLight.Brightness = 0
wait(3)
workspace.Sound7.Playing = false
wait(2)
door.CFrame = CFrame.new(2.232, 4.691, 4.273) * CFrame.Angles(0, 0.1, 1.575)
wait(0.3)
door.CFrame = CFrame.new(2.232, 4.691, 4.473) * CFrame.Angles(0, 0.125, 1.575)
wait(0.3)
door.CFrame = CFrame.new(2.232, 4.691, 4.673) * CFrame.Angles(0, 0.175, 1.575)
wait(0.3)
door.CFrame = CFrame.new(2.232, 4.691, 4.873) * CFrame.Angles(0, 0.225, 1.575)
if door.CFrame == CFrame.new(2.232, 4.691, 4.873) * CFrame.Angles(0, 0.225, 1.575) then
door.ClickDetector.MaxActivationDistance = 40
end
for _, player in pairs(game.Players:GetChildren()) do
if playerSafe == true then
vent.CFrame = CFrame.new(vent.Position) * CFrame.Angles(0,1.575,0)
else
wait(10)
player:Kick("No one clicked the button")
end
end
end)
You’re waiting 10 seconds after the script already checked if playerSafe was true. So the script already determined what is going to happen to the player before giving the player a chance to do anything. You need to move the wait outside of the if statement.
Yooooooo!!! It worked! I’ve been looking for soooo long! Thank you!!!