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

how would you make a model spin locally?

I have a fan that spins to add extra effect to the map, and in hopes to reduce lag (my game has over 1200 client memory usage) i want to make it a local script. its a standard spin script

local fan = script.Parent.Parent
while true do
	fan.PrimaryPart = fan.center
fan:SetPrimaryPartCFrame(fan.center.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
wait()
end

but i want to make it local. i tried to put it in a local script but that didnt work.. now that im writing this it may be impossible idk help would be appreciated

1 comment

0

i just realized that i should move the primary part definition outside of the loop lol

1 answer

local fan = script.Parent.Parent

local function partRotation(part)
while true do
	    fan.PrimaryPart = fan.center
	fan:SetPrimaryPartCFrame(fan.center.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
	wait()
	end
end

partRotation()

put this in a local script also

edit: forgot to call function

2 comments

0

doesnt work- when i test the fan doesnt spin

0

:(

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