✓ Accepted answer
Here are two different methods on how to do it.
METHOD 1:
Toggle the Humanoid's property, PlatformStand.
This will stop the user from moving or standing up, but upon testing you will see that the player is almost standing inside the ground.
ADVANTAGES:
- Handled through 1 script
- Simple
- Works
DISADVANTAGES:
local touchedBanana = false
local slipDelay = 3
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if touchedBanana then return end
local char = player.Character
if char then
local hum = char:FindFirstChildWhichIsA("Humanoid")
if hum then
touchedBanana = true
hum.Sit = true
hum.PlatformStand = true
delay(slipDelay,function()
hum.PlatformStand = false
touchedBanana = false
end)
end
end
end
end)
METHOD 2:
Tell the client to disable player controls, taking away their power to stand.
This way they can't move or do anything and are merely flopped until otherwise said
ADVANTAGES:
- Player will actually remain sat
- Efficient
- Works
DISADVANTAGES:
- Exploiters can reverse this
- Handled through 2 scripts
SCRIPT INSIDE BANANA
local touchedBanana = false
local bananaEvent = game:GetService("ReplicatedStorage"):FindFirstChild("BananaSlip") or Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
bananaEvent.Name = "BananaSlip"
local slipDelay = 3
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if touchedBanana then return end
local char = player.Character
if char then
local hum = char:FindFirstChildWhichIsA("Humanoid")
if hum then
touchedBanana = true
bananaEvent:FireClient(player, slipDelay)
hum.Sit = true
delay(slipDelay,function()
touchedBanana = false
end)
end
end
end
end)
LOCALSCRIPT INSIDE StarterPack
local bananaSlip = game:GetService("ReplicatedStorage"):WaitForChild("BananaSlip")
bananaSlip.OnClientEvent:Connect(function(t)
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
controls:Disable()
delay(t,function()
controls:Enable()
end)
end)
If this works, please don't forget to accept my answer.
Thanks in advance,
R455
1 comment
Although I found another solution, your answer is also very helpful and it works :)