Yeah, all the model locations are in the right place, but is it scripted correctly?
This is my first time at any MAJOR scripting, so I doubt it, but could someone read through it and see if it will, and if not what needs correcting.
Thank you!
===
model = game.Workspace.FactoryInABox1.toaster1
local toastercopy = game.Workspace.FactoryInABox1.toaster1:clone()
function Regentoaster()
game.Workspace.FactoryInABox1.toaster1:remove()
local new_stuff = toastercopy:clone()
new_stuff.Parent = game.Workspace.FactoryInABox1
new_stuff:makeJoints()
function onChatted(msg, recipient, speaker)
-- convert to all lower case
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "start making cake") then
if isenabled~=0 then
local toast=game.Workspace.FactoryInABox1.toast:clone()
isenabled=0
toast.Parent=game.Workspace
toast.Transparency=0
toast.Locked=false
toast.Anchored=false
toast.CanCollide=true
toast.RotVelocity=Vector3.new(0,0,0)
local toastrot=CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
toast.CFrame = script.Parent.toaster.CFrame * CFrame.new(Vector3.new(0,0,0)) * toastrot
wait(1)
isenabled=1
end
end
if (msg == "open door") then
wait(0.1)
Regentoaster()
wait(0.1)
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
=== |