so, I made a part that changes he workspace’s gravity whenever you touch it. But it only works when the script is open. here’s the script:
local part = game.Workspace.LowGravBrick
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print(game.Workspace.Gravity)
game.Workspace.Gravity = 55
print(game.Workspace.Gravity)
end
end)
this is in a local script because I wanted it to only change the gravity for the person who touched it.
If you’re running this inside a LocalScript, you could simplify it a LOT more.
local part = workspace.LowGravBrick
local player = game.Players.LocalPlayer
part.Touched:Connect(function(hit)
if hit.Parent == player.Character then
print(game.Workspace.Gravity)
game.Workspace.Gravity = 55
print(game.Workspace.Gravity)
end
end)
The problem is the local script. Where are you placing the local script? Local scripts can only work in workspace if it’s inside the player’s character. So to do this, you would need to put it in a server script, when touched, detect the player that touched it, fire a remote event to that specific player and then when the signal is received by the player, locally change their gravity.
or yeah, you could just change the parent of the script to starter gui lol