Script is,
local Workspace = game.Workspace
local StarterGui = game.StarterGui
local ReplicatedStorage = game.ReplicatedStorage
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local barrier = Workspace:WaitForChild("Levels"):WaitForChild("LevelSun"):WaitForChild("MercuryGravityBarrier")
local runbefore = false
local function changegravityGUI()
local GravityIndicatorMercury = StarterGui.ScreenGui.GravityIndicatorSun:clone()
GravityIndicatorMercury.Parent = StarterGui.ScreenGui
GravityIndicatorMercury.Name = 'GravityIndicatorMercury'
GravityIndicatorMercury.Zindex = 3
GravityIndicatorMercury.Image = 'rbxassetid://117685724959818'
end
local function touched(hit)
if runbefore == false then
print('hi')
runbefore = true
local humanoid = hit.Parent:FindFirstChild("Humanoid")
print(hit.Parent)
print(humanoid)
if humanoid == 'Humanoid' then
changegravityGUI()
print('worked')
RemoteEvent:FireServer(196.2 * 0.38)
end
end
end
barrier.Touched:Connect(touched)
--edit
But from line 19
print(hit.Parent)
I’m getting the message