Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the Rotation in Line 31 the same as the other Rotation and make it work anywhere?

Asked by 9 years ago

I am having trouble in line 30 for the Rotation. I want it to be like the other rotation where I use this method: tune.Rotation.X or Z. Also, I want to know, is there any way to make this script where ever the model is? Like let say it is positioned in the center (the whole model) and I rotated it to make it better, how can I make the rotation that I provided still works? Hope I asked the question clear. This is the script:

--Credit: Spongocardo
local tune = game.Workspace.Radio.Tune
local pic = workspace.SongPosters.Decal
sound = Instance.new("Sound", tune)
debounce = false
radioOn = false

function onClicked()
    if debounce then return end --Stop the function if debounce is true.
    debounce = true
    if not radioOn then
        radioOn = true
        tune.Rotation = Vector3.new(tune.Rotation.X, -69.598, tune.Rotation.Z)
        pic.Texture = "rbxassetid://174956680"
        sound.SoundId = "rbxassetid://142295308" --Playing It's Raining Tacos
        sound:Play()
    elseif radioOn and sound.SoundId == "rbxassetid://142295308" then
        sound:Stop()
        tune.Rotation = Vector3.new(tune.Rotation.X, -51.347, tune.Rotation.Z)
        pic.Texture = "rbxassetid://238387775"
        sound.SoundId = "rbxassetid://209864226" -- Barack Obama Uptown Funk
        sound:Play()
    elseif radioOn and sound.SoundId == "rbxassetid://209864226" then
        sound:Stop()
        tune.Rotation = Vector3.new(tune.Rotation.X, -32.948, tune.Rotation.Z)
        pic.Texture = "rbxassetid://"
        sound.SoundId = "rbxassetid://131111368" --Playing Radioactive
        sound:Play()
    elseif radioOn and sound.SoundId == "rbxassetid://131111368" then
        sound:Stop()
        tune.Rotation = Vector3.new(-90, 81.181, -90)
        pic.Texture = "rbxassetid://"
        sound.SoundId = "rbxassetid://130776004" --Playing Everyday I'm Shuffling! 
        sound:Play()
    elseif radioOn and sound.SoundId == "rbxassetid://130776004" then
        radioOn = false
        sound:Stop()
        tune.Rotation = Vector3.new(tune.Rotation.X, -89.282, tune.Rotation.Z)
        pic.Texture = "rbxassetid://271952704"
        print("Off")
    end
    debounce = false
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

0
If you want to use the X and Z properties, just use them... Perci1 4988 — 9y
0
I know. but the others have the rotation of 90 until I get to where the X or Z turns to a -90. And I when I rotate the whole model, it like makes the Rotation into like 0, something, 0 instead of 90 or -90. that is why I want it to be fixed RobotChitti 167 — 9y

Answer this question