Cframe doesnt activate right. Help!

Basically I have a keybind and if you hold a key it’ll activate a script which is a cframe, instead. The cframe just doesn’t happen.
Heres the code for the keybind…

UIS = game:GetService(“UserInputService”)
UIS.InputEnded:Connect(function(Input, isTyping)
if isTyping then return end
while true do
wait()
if UIS:IsKeyDown(Enum.KeyCode.D) then
workspace.cframer.Script.Disabled=false
wait()
end
UIS.InputEnded:Connect(function()
workspace.cframer.Script.Disabled = true
wait()
end)
end
end)

and heres the code for the cframe
while true do
script.Parent.CFrame=script.Parent.CFrame*CFrame.new(0,0,1.5)
wait()
end
(keybind script is in startplayerscripts, cframe is in a torso of a rig im trying to make move)

Chances are it’s a localscript activating a serverscript.
This doesn’t work because regular scripts are serversided, localscripts effect the client only.

Any way to make it serversided?

RemoteEvents and RemoteFunctions. Preferably use RemoteEvents if you only need to run an action that doesn’t have to return anything.

I’ll search up on it, i’m a rookie and havent even touched remote events or functions

How do you fire a script.Disabled with remote events / functions?

Have a remote event in replicated storage and use FireServer along with OnServerEvent

You wouldn’t need to enable a script with these functions; they call on a function defined in the script.

I really do not understand this, might cancel this project and work on it when I understand more.

They may seem difficult, but trust me, they aren’t. The most difficult thing nowadays after getting used to them is remembering that when called from a localscript it’ll pass the player as the first variable.

Think of RemoteEvent:FireServer() as a property change, and you are picking that change up from the server script.

That’s probably a good idea, you should first make sure you understand a good amount before moving on to something ambitious.

I don’t really think this is ambitious, It’s just activating a script serversidedly.