So I made a windmill kinda thing, but then I realized that using Scripts are not efficient, so I tried using LocalScript. But nothing happened afterward. The thing wasn’t spinning.
the LocalScript:
local a = script.Parent
local b = a:WaitForChild'Windmill1':WaitForChild'model'
local c = a :WaitForChild'Windmill2':WaitForChild'model'
while true do
b:SetPrimaryPartCFrame(b:GetPrimaryPartCFrame() * CFrame.Angles(1/120, 0, 0))
c:SetPrimaryPartCFrame(c:GetPrimaryPartCFrame() * CFrame.Angles(1/120, 0, 0))
game:GetService("RunService").RenderStepped:Wait()
end
2 Likes
LocalScripts only work on the client (player), and Scripts only work on the Server. Meaning a LocalScript can’t run in workspace, where I assume the windmill is located.
Does the player have network ownership? The client is not able to modify values of the server without a RemoteEvent.
Additionally:
Client refers to the local player, where local scripts should be stored.
Server refers to the server, where scripts are stored.
Any script in the workspace should not be a local script, it should instead be a script.
So it can be ran if the script is located in the player?
Technically yes, but only the player with the script will be able to see it. But if you give the script to everyone, like in starter scripts, everyone should be able to see it spin. And you would obviously have to change the variable ‘a’ too.