Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

script.Disabled = true but its still running?

i am making an SCP game and i am trying to make SCP 173 heres the script:

local RunService = game:GetService("RunService")

local npc = workspace.NPC
local character = game.Players.LocalPlayer.Character

RunService.RenderStepped:Connect(function()
	local npcToCharacter = npc.Head.CFrame.LookVector
	local npcLook = (character.Head.Position - npc.Head.Position).Unit
	
	local dotProduct = npcToCharacter:Dot(npcLook)
	
	print(dotProduct)
	
	if dotProduct > .5 then
		workspace.NPC.Follow.Disabled = false
		workspace.Baseplate.BrickColor = BrickColor.new("Black")
	else
		workspace.NPC.Follow.Disabled = true
		workspace.Baseplate.BrickColor = BrickColor.new("Baby blue")
	end
end)

the script is from https://www.youtube.com/watch?v=BUwAcW_18Ws and modified by me I already put workspace.NPC.Follow.Disabled = true but disabled is still false when running the game.Help appreciated!

4 comments

0

im pretty sure this is a local script, this is a local script right? if it is, then you cant access server scripts and change them

0

then how do i make them can access server tho?

0

is it remote event

0

me wondering why people are not sure if this is a local script. "LocalPlayer" "RenderStepped" l o l, this question has already been answered so thats y this is useless

1 answer

✓ Accepted answer

This is a local script, i can tell by RenderStepped, which only works in local scripts, This means you can not disable or enable any scripts because you cant make server side changes directly from the client, you need to make a remote event, and call it with the local script. Then make any server side script to listen to that remote event, and when it fires, then make the scripts disabled that you want, and make any other serverside changes you want since its a server script running the server side changes.

2 comments

0

it still doesnt work but i will make your answer a solution

0

what doesnt work? ill still help

This discussion is preserved as it was. New answers, comments, and votes are closed.