How to make gravity coil go based on workspace.Gravity

A problem I am having with insert a gravity coil into the game is I have different gravity settings (100) however, the gravity coil code goes on a set number (196.20, default gravity) and since the gravity coil ‘cancels 75% of gravity’s effect on your character’ it means at 100, my character just gets rocketed into the air.

  1. Why is the script written like this and not workspace.Gravity?
  2. How can I edit this when using InsertService?
local Item = InsertService:LoadAsset(ItemData.ID):GetChildren()[1]
Item.Name = item
Item.Parent = player.Backpack

I know I could just have the item preloaded and write the script however I want, but, would rather just insert it into the game like so, otherwise I’d have to either have all catalog items preloaded into the repstorage, which is not ideal, or have it so only the gravity coil is reploaded in repstorage (also not ideal)

1 Like

You won’t be able to at runtime. Source can only be changed by a plugin in Studio.

Based on your preferences in the post, I’d recommend editing it, publishing it as your model, and then inserting that ID instead of the one you’re currently using. That way it’s not in rep storage when it doesn’t need to be, and you don’t need to change your insertion code at all, just swap the ID.

3 Likes