K,n in pairs you dont have permission error (help)

im writing a lava brick script that hurts the player when they touch it but any brick names “lava” gets that attribute. For some reason i keep getting the same error "you dont have premission or something."
Screen Shot 2020-11-02 at 12.33.57 AM

  1. Heres where the script is located. !

Screen Shot 2020-11-02 at 12.35.00 AM

-- Lastly the script itself.--

Try not to get the game’s children, as there may be hidden services which are inaccessible by default means. You are looking for workspace instead.

thats the only method i know since im new at lua. do you mean do for k,n in pairs (game.workspace()) do if n.Name == “lava” etc or (game.workspace:GetChildren())

workspace:GetChildren(), which returns an array of the workspace’s children.

game.Workspace works, but workspace is a global. Both works, just write whatever fits, but the first one would be alternated to game:GetService("Workspace").

alright. thank you guys, its working now. i dont know to to mark as got the solution since you both did but still thanks!