I am trying to make a Block where if I touch it, It makes the player that touched it Enable PlatformStanding property. I have made a script but it does not work. (P.S the script is inside a LocalScript Inside of a tool. I want it so if the player is somebody with the tool it enables PlatformStanding.) Here is the script:
local tool = script.Parent
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local humanoid = hit.Parent:FindFirstChild("Humanoid")
local debounce = false
Player.CharacterAdded:Connect(function(char)
character = char
humanoid = character:WaitForChild("Humanoid")
end)
tool.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not debounce then
debounce = true
humanoid.PlatformStand = true
wait(5)
humanoid.PlatformStand = false
debounce = false
end
end
end)
I removed body impulse cuz I forgot that i just want the player to fall
you’re only checking to make sure the touching part belongs to a character. If it does then you’re flinging the local character backwards, regardless of which character actually touched the part.
No; client physics updates will pass the replication filter when they’re made on assemblies that have network ownership assigned to them. A client always has network ownership over it’s own character.
Touched is an event of parts. Tools dont have a touched event. Did you mean Tool.Handle by chance? Atm the only character it can update is the local character, but I’m guessing youd like it to fling other characters when you run up and touch them with it. You’re going to need to move it to a server script for that, and change the filter to only work for hit.Parents that dont equal this character (if hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= character then)
also quick question Ive seen people make it when PlatformStanding is turned on the player ragdolls. Ive tried but it does not work. I just wanted to know how it works
You have to replace the rig’s motor6d’s with ballsocketconstraints. It’s kinda complex; try searching around devforum/freemodels for a module that can make the ragdoll for you.