I made a giant cancollide transparent brick and I put this script in it
function onTouch() game.Players.PlayerAdded.Jump = false end
script.Parent.Touched:connect(onTouch)
I want to make it where once you get out of the transparent brick you can jump again so im guessing i would need to make an if then function? but im not sure.
also I don't know how i would identify the character that the person is playing as, and not everyone in the server
edit:
local script (in starterkit)
local remoteEvent = game.ReplicatedStorage:WaitForChild("ActivateTouch")
local Touchends = game.ReplicatedStorage:WaitForChild("Touchend")
--When Touched
remoteEvent.OnClientEvent:connect(function(player)
player.Character.Humanoid.JumpPower = 0
end
--When Touchends
Touchends.OnClientEvent:connect(function()
player.Character.Humanoid.JumpPower = 50
end
script (in workspace)
detecttouch = game.Workspace.nojump
--Create remote event on Touched to communicate between server and player scripts(client)
local RemoteEvent = instance.new("RemoteEvent")
RemoteEvent.Parent = game.WaitForChild("ReplicatedStorage")
RemoteEvent.Name = "ActivateTouch"
--Create remote event for TouchEnded
local RemoteEvent = instance.new("RemoteEvent")
Touchends.Parent = game.WaitForChild("ReplicatedStorage")
Touchends.Name = "Touchend"
--When Touched
detecttouch.Touched:connect(function(hit)
--get the humanoid (This is how you find for humanoid with an Touched event)
humanoid = hit.Parent.FindFirstChild("Humanoid")
--Check for humanoid (Only found in players, so that other parts which touch this will not activate this script)
if humanoid then
local player = hit.Parent.GetPlayerFromCharacter()
RemoteEvent:FireClient(player)
end
end
--When Touch ends
detecttouch.TouchEnded:connect(function(hit)
--Can't delete hit as these are two separate functions
humanoid = hit.Parent.FindFirstChild("Humanoid")
local player = hit.Parent.GetPlayerFromCharacter()
Touchends:FireClient(player)
end

1 comment
Hi there, try out my answer, I do suggest you set filteringenabled to true.