#help with refering to a part
1 messages · Page 1 of 1 (latest)
yes, is the wall inside the model? in the image it doesnt look like the wall is inside the model you are referencing
let me know if you get it to work
ya it works, srry for the dumb question lol
i didn't realize the solution was so easy
how would i make a spinning block? is that scripting related or is there a special thing in studio for that?
You have to script it
You can simply loop changing it's orientation
If you want it to look smooth tween it
so uh
i did the quick fill thing that roblox recommended i did
and it spins the wrong way lol
what does math.rad do?
Converts degrees to radians
Say you want to rotate a part by 30 degrees
To use CFrame.angles() if you put a 30 inside that's 30 radians not degrees
Which is massive
So you put math.rad(30)
Which just means convert 30 degrees to radians so I can use it in CFrame.angles
it is spinning at like mach 30 lol
😭
Add a task.wait
local RunService = game:GetService("RunService")
local part = script.Parent -- change to your part
local rotationSpeed = 60 -- change this for rotation speed
RunService.RenderStepped:Connect(function(deltaTime)
local rotation = rotationSpeed * deltaTime
part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(rotation), 0)
end)
whats the difference between wait() and task.wait()
Wait is the legacy version
Task.wait is more precise and less buggy
Wait can depend on server performance
So if the server lagged it would affect it
And I think your actual frame rate can mess with it
and whats the difference between part.material.neon and enum.material.neon?
UH
i made the spinning part into a killbrick and it crashed roblox studio
local spinner = script.Parent
spinner.CanCollide = true
spinner.Anchored = true
local spinspeed = 5
while true do
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(spinspeed),0)
wait(.0001)
spinner.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = humanoid.Health == 0
print("player health set to 0")
end
end)
end
ok it unfroze
Part.material is specifically the material property stored inside the part
Enum.material gets all the material labels
I imagine like a long list of all Roblox materials stored inside it
So you can assign part.material = enum.material.metal
Idk if that's how you actually do it
But the theory is there
Okay don't wait(0.0001) lol
May as well not have it