local part = workspace:WaitForChild("Part")
part.Touched:Connect(function(hit)
if (hit.Parent:FindFirstChildWhichIsA("Humanoid")) and (hit.Parent:FindFirstChild("Humanoid") == game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")) then
if not workspace.Gravity ~= 100 then
workspace.Gravity = 100-- your new gravity here
end
end
end)
All I did was add a not in your script. So instead of checking if the gravity is ___ it checks if the gravity is not ___, so you can add a lot of the same script over and over again for different areas without having to add if gravity = number and if gravity = number etc. etc. .
Uh, if workspace.Gravity ~= 100 then does exactly that. It only changes the gravity if the gravity is not 100, so once it is 100, the code will never run again. On the other hand, your inclusion of not means that the code will only run if the gravity of the workspace is 100, which isnāt helpful.
By the way the ~ in ~= means not equal to, not equal to. Unless I am missing somethingā¦?